diff --git a/README.rst b/README.rst index 21e13be..3d50c3e 100644 --- a/README.rst +++ b/README.rst @@ -541,10 +541,10 @@ fork and then clone the project. Packaged with Pilbox is a `Vagrant `_ configuration file which installs all necessary dependencies on a -virtual box using `Ansible `_. See the +virtual box using `Ansible `_. See the `Vagrant documentation `_ and the `Ansible -documentation `_ +documentation `_ for installation instructions. Once installed, the following will start and provision a virtual machine. diff --git a/Vagrantfile b/Vagrantfile index 2d7cde3..1e95f97 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,13 +1,21 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +bootstrap_script = < "vagrant" - - # Enable provisioning with Ansible. Ansible playbooks are contained - # in a directory path relative to this Vagrantfile. - config.vm.provision :ansible do |ansible| - ansible.playbook = "provisioning/playbook.yml" - ansible.inventory_path = "provisioning/vagrant" - ansible.verbose = true - ansible.limit = 'all' - end + config.vm.synced_folder ".", "/var/www/pilbox", :owner => 'vagrant' + # The machine performs its own provisioning. + config.vm.provision 'shell', inline: bootstrap_script, privileged: false + config.vm.provision 'file', { + source: '~/.vagrant.d/insecure_private_key', + destination: '~/.ssh/id_rsa', + } + config.vm.provision 'shell', inline: ansible_script, privileged: false end diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 8f277a8..2758901 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -11,6 +11,7 @@ become: True tasks: + - group: name=admin state=present - user: name=ansible groups=admin shell=/bin/bash password=ansible state=present - file: path=/etc/sudoers.d mode=0770 owner=root group=root state=directory - copy: src=files/etc/sudoers dest=/etc/sudoers mode=0440 owner=root group=root