From 1837c00186706aecc5d9a1105799de08e87e6e6c Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 11 May 2018 15:13:45 -0400 Subject: [PATCH 1/5] Fix reseting the interface --- roles/configure-interfaces/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/configure-interfaces/tasks/main.yml b/roles/configure-interfaces/tasks/main.yml index afa3a62..c3eb603 100644 --- a/roles/configure-interfaces/tasks/main.yml +++ b/roles/configure-interfaces/tasks/main.yml @@ -10,9 +10,9 @@ template: src=../roles/configure-interfaces/templates/eth.cfg.j2 dest=/etc/network/interfaces.d/{{ interface_name }}.cfg - name: Up down interface - shell: ifdown {{ interface_name }} && ifup {{ interface_name }} - async: 0 - poll: 0 + shell: "(sleep 3s; ifdown {{ interface_name }} && ifup {{ interface_name }};) &" ignore_errors: true vars: interface_name: eth0 + async: 100 + poll: 0 From f58851170b01be826a6b9b567c859e64159a23d8 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Sun, 1 Jul 2018 13:07:24 -0400 Subject: [PATCH 2/5] Make the share location a var --- group_vars/all | 3 ++- roles/common/tasks/main.yml | 4 ++-- roles/developer-machine/tasks/main.yml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/group_vars/all b/group_vars/all index f685ab7..4d65145 100644 --- a/group_vars/all +++ b/group_vars/all @@ -6,7 +6,8 @@ docker_ce_version_to_install: 17.09.1~ce-0~ubuntu nvm_version: v0.33.5 node_version: 8.4.0 registry_location: "registry.wimer.home:5000" -nfs_location: 10.0.0.150 +nfs_location: 10.0.0.150i +nfs_share:/volumeUSB5/usbshare home_pub_key: https://raw.githubusercontent.com/jcwimer/ubuntu-template/master/post/id_rsa.pub standard_user: cody git_user: "Jacob Cody Wimer" diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 2895c62..bc304fd 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -109,12 +109,12 @@ lineinfile: dest=/etc/fstab regexp=\/data state=present - line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults,nolock 0 0" + line="{{ nfs_location }}:{{ nfs_share }}/raw-files/fileserver/shares/lab-data /data nfs defaults,nolock 0 0" - name: Mount USB lab data directory mount: path: /data - src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data + src: 10.0.0.150:{{ nfs_share }}/raw-files/fileserver/shares/lab-data state: mounted fstype: nfs ignore_errors: true diff --git a/roles/developer-machine/tasks/main.yml b/roles/developer-machine/tasks/main.yml index a751812..b710387 100644 --- a/roles/developer-machine/tasks/main.yml +++ b/roles/developer-machine/tasks/main.yml @@ -101,13 +101,13 @@ lineinfile: dest=/etc/fstab regexp=\/raw-files state=present - line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files /raw-files nfs defaults 0 0" + line="{{ nfs_location }}:{{ nfs_share }}/raw-files /raw-files nfs defaults 0 0" - name: Mount USB raw files to data directory when: not raw_mounted.stat.exists mount: path: /raw-files - src: 10.0.0.150:/volumeUSB1/usbshare/raw-files + src: 10.0.0.150:{{ nfs_share }}/raw-files state: mounted fstype: nfs ignore_errors: true From e3fcd8e9ebfe69235fafcc2d32044c8fcfa60469 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Sun, 1 Jul 2018 13:38:07 -0400 Subject: [PATCH 3/5] Fixed yml syntax error --- group_vars/all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all b/group_vars/all index 4d65145..d0e664f 100644 --- a/group_vars/all +++ b/group_vars/all @@ -7,7 +7,7 @@ nvm_version: v0.33.5 node_version: 8.4.0 registry_location: "registry.wimer.home:5000" nfs_location: 10.0.0.150i -nfs_share:/volumeUSB5/usbshare +nfs_share: /volumeUSB5/usbshare home_pub_key: https://raw.githubusercontent.com/jcwimer/ubuntu-template/master/post/id_rsa.pub standard_user: cody git_user: "Jacob Cody Wimer" From 5ce2f473d60c2f6dd1d8434fa6ff7a129ef06051 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Sun, 1 Jul 2018 13:38:17 -0400 Subject: [PATCH 4/5] Added reboot playbook --- playbooks/reboot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 playbooks/reboot.yml diff --git a/playbooks/reboot.yml b/playbooks/reboot.yml new file mode 100644 index 0000000..0f5e9fa --- /dev/null +++ b/playbooks/reboot.yml @@ -0,0 +1,10 @@ +--- + +- name: Create machine and set up ip + hosts: all + user: root + gather_facts: no + serial: 100% + tasks: + - name: Reboot + command: reboot From a07b003384bbe5a68231283a9e3e426c89a571b0 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Sun, 1 Jul 2018 13:49:28 -0400 Subject: [PATCH 5/5] Added an ad-hoc command script --- supporting-scripts/ad-hoc-command.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 supporting-scripts/ad-hoc-command.sh diff --git a/supporting-scripts/ad-hoc-command.sh b/supporting-scripts/ad-hoc-command.sh new file mode 100644 index 0000000..5f5422e --- /dev/null +++ b/supporting-scripts/ad-hoc-command.sh @@ -0,0 +1 @@ +ANSIBLE_HOST_KEY_CHECKING=False ansible all -i hosts -u root -a "reboot"