diff --git a/Vagrantfile b/Vagrantfile index ffc0930c3d69d0cd66f1966e9be5f97076ad77ac..6e8513678b6b066c1c8fd1b8a4ec8bd3ef69baea 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,10 +16,9 @@ Vagrant.configure(2) do |config| end config.vm.define "openbsd" do |openbsd| + openbsd.vm.hostname = "openbsd.Ansible.vagrant" openbsd.vm.box = "tmatilai/openbsd-5.7" #openbsd.vm.box = "twingly/openbsd-5.7-amd64" - openbsd.vm.network "forwarded_port", guest: 443, host: 8000 - openbsd.vm.network "forwarded_port", guest: 80, host: 8001 end config.vm.define "kodi" do |kodi| diff --git a/host_vars/openbsd b/host_vars/openbsd new file mode 100644 index 0000000000000000000000000000000000000000..7aef74863a1b8c79da7fc4c6ecb93eb4f8826753 --- /dev/null +++ b/host_vars/openbsd @@ -0,0 +1 @@ +openbsd_bootstrap: True diff --git a/openbsd-bootstrap.yml b/openbsd-bootstrap.yml deleted file mode 100644 index 61988a06797fc9115bdc2794cadf1b9dd0ab86ca..0000000000000000000000000000000000000000 --- a/openbsd-bootstrap.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# Bootstrap an OpenBSD machine to be able to run Ansible on it. - -- hosts: - - openbsd - vars: - ansible_python_interpreter: /usr/local/bin/python2.7 - pkg_mirror: http://www.mirrorservice.org/pub - tasks: - - name: Install Python - raw: "PKG_PATH={{ pkg_mirror }}/OpenBSD/$(uname -r)/packages/$(arch -s)/ /usr/sbin/pkg_add py-pip" - register: pkg_add_python - changed_when: "'python' in pkg_add_python.stdout" - - - name: Symlink python - file: - path: /usr/bin/python - src: /usr/local/bin/python2.7 - state: link - force: yes - - - name: Gather facts - setup: - - - name: Configure pkg - lineinfile: - dest: /etc/pkg.conf - line: 'installpath = {{ pkg_mirror }}/OpenBSD/{{ ansible_distribution_release }}/packages/{{ ansible_architecture }}/' - regexp: '^installpath =' - state: present - create: yes - - - name: Install Bash - openbsd_pkg: - name: bash - state: latest diff --git a/site.yml b/site.yml index 55a5c9a3cce9924d5e2f52ffea80b938ea5d79e4..2ece3024dc17acc45106951478f981d2950eec4a 100644 --- a/site.yml +++ b/site.yml @@ -1,6 +1,7 @@ --- - hosts: - all + gather_facts: '{{ openbsd_bootstrap is defined }}' roles: - common