Vargant support and extended build file
diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml
new file mode 100644
index 0000000..46f473c
--- /dev/null
+++ b/ansible/roles/common/defaults/main.yml
@@ -0,0 +1,11 @@
+hosts: [
+ { host_ip: "10.100.198.220", host_name: "voltha"},
+]
+
+use_latest_for:
+ - debian-keyring
+ - debian-archive-keyring
+
+obsolete_services:
+ - puppet
+ - chef-client
diff --git a/ansible/roles/common/files/ssh_config b/ansible/roles/common/files/ssh_config
new file mode 100644
index 0000000..990a43d
--- /dev/null
+++ b/ansible/roles/common/files/ssh_config
@@ -0,0 +1,3 @@
+Host *
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null
diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml
new file mode 100644
index 0000000..3391255
--- /dev/null
+++ b/ansible/roles/common/tasks/main.yml
@@ -0,0 +1,40 @@
+- name: JQ is present
+ apt:
+ name: jq
+ force: yes
+ tags: [common]
+
+- name: Host is present
+ lineinfile:
+ dest: /etc/hosts
+ regexp: "^{{ item.host_ip }}"
+ line: "{{ item.host_ip }} {{ item.host_name }}"
+ with_items: hosts
+ tags: [common]
+
+- name: Latest apt packages
+ apt:
+ name: "{{ item }}"
+ with_items: use_latest_for
+ tags: [common]
+
+- name: Services are not running
+ service:
+ name: "{{ item }}"
+ state: stopped
+ ignore_errors: yes
+ with_items: obsolete_services
+ tags: [common]
+
+- name: Ensure known_hosts file is absent
+ file:
+ path: "{{ ansible_env['PWD'] }}/.ssh/known_hosts"
+ state: absent
+
+- name: Disable Known Host Checking
+ copy:
+ src: files/ssh_config
+ dest: "{{ ansible_env['PWD'] }}/.ssh/config"
+ owner: "{{ ansible_env['SUDO_USER'] }}"
+ group: "{{ ansible_env['SUDO_USER'] }}"
+ mode: 0600