From df6cfd8462e3aaf660da77ddf360034f83e7ba8c Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 13 Dec 2015 09:14:41 +0200
Subject: [PATCH] - Merged OpenBSD bootstraping to the common role.

---
 Vagrantfile           |  3 +--
 host_vars/openbsd     |  1 +
 openbsd-bootstrap.yml | 36 ------------------------------------
 site.yml              |  1 +
 4 files changed, 3 insertions(+), 38 deletions(-)
 create mode 100644 host_vars/openbsd
 delete mode 100644 openbsd-bootstrap.yml

diff --git a/Vagrantfile b/Vagrantfile
index ffc0930..6e85136 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 0000000..7aef748
--- /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 61988a0..0000000
--- 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 55a5c9a..2ece302 100644
--- a/site.yml
+++ b/site.yml
@@ -1,6 +1,7 @@
 ---
 - hosts:
   - all
+  gather_facts: '{{ openbsd_bootstrap is defined }}'
   roles:
   - common
 
-- 
GitLab