From ee66afacbc68fb3c6917ec949cdde47fa1502a24 Mon Sep 17 00:00:00 2001 From: Cody Wimer Date: Wed, 26 Jul 2017 21:35:30 -0400 Subject: [PATCH] Added nfs mount, sshpass, and serialization to playbook --- group_vars/all | 4 ++-- playbooks/developer-machine.yml | 6 ++++-- roles/common/tasks/main.yml | 13 +++++++++++++ roles/common/templates/fstab.j2 | 12 ++++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 roles/common/templates/fstab.j2 diff --git a/group_vars/all b/group_vars/all index 30b030b..4a4ab14 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,5 +1,5 @@ --- # Variables listed here are applicable to all host groups -docker_compose_version_to_install: 1.13.0 -docker_ce_version_to_install: 17.03.0~ce-0~ubuntu-{{ ansible_distribution_release }} +docker_compose_version_to_install: 1.14.0 +docker_ce_version_to_install: 17.06.0~ce-0~ubuntu diff --git a/playbooks/developer-machine.yml b/playbooks/developer-machine.yml index f8887e3..fee0ec5 100644 --- a/playbooks/developer-machine.yml +++ b/playbooks/developer-machine.yml @@ -2,13 +2,15 @@ # This playbook deploys a development machine - name: Apply common configuration to all nodes - hosts: developer-machines + hosts: all user: root + serial: 100% tasks: - include: ../roles/common/tasks/main.yml -- name: Apply common configuration to all nodes +- name: Set up developer machine hosts: developer-machines user: root + serial: 100% tasks: - include: ../roles/developer-machine/tasks/main.yml diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index afe4221..01499d1 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -29,12 +29,18 @@ - ntp - mysql-client - wget + - nfs-common - docker-ce={{docker_ce_version_to_install}} + - sshpass - name: Set git username + become: yes + become_user: cody shell: git config --global user.name "Jacob Cody Wimer" - name: Set git email + become: yes + become_user: cody shell: git config --global user.email "jacob.wimer@gmail.com" - name: Docker compose version @@ -58,6 +64,13 @@ - name: Replace sudoers file template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers +- name: Creates directory + file: path=/data state=directory + +- name: Mount data directory + shell: mount 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data/{{ ansible_hostname }} /data + ignore_errors: yes + - name: test for swap partition shell: swapon -s | grep -E "^/" register: swapfile diff --git a/roles/common/templates/fstab.j2 b/roles/common/templates/fstab.j2 new file mode 100644 index 0000000..e7ad251 --- /dev/null +++ b/roles/common/templates/fstab.j2 @@ -0,0 +1,12 @@ +# /etc/fstab: static file system information. +# +# Use 'blkid' to print the universally unique identifier for a +# device; this may be used with UUID= as a more robust way to name devices +# that works even if disks are added and removed. See fstab(5). +# +# +# / was on /dev/sda1 during installation +UUID=a4a5a54f-1022-47b3-9c50-77c6139d7fc9 / ext4 errors=remount-ro 0 1 +# swap was on /dev/sda5 during installation +UUID=0f47da63-9d7d-487c-8b99-ea7d5497f7f7 none swap sw 0 0 +10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data/{{ ansible_hostname }} /data nfs defaults 0 0 \ No newline at end of file