From 37301588807f78f6b88f4a2bda5f2f41757c532f Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Fri, 17 Apr 2015 10:33:26 -0500 Subject: [PATCH] Reorganizing tasks that debian and ubuntu both need. Signed-off-by: Andrew Schoen --- roles/testnode/tasks/apt_systems.yml | 41 +++++++++++++++++++++++++ roles/testnode/tasks/setup-ubuntu.yml | 43 ++------------------------- roles/testnode/tasks/static_ip.yml | 4 --- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/roles/testnode/tasks/apt_systems.yml b/roles/testnode/tasks/apt_systems.yml index 1cfac7e..b0937dd 100644 --- a/roles/testnode/tasks/apt_systems.yml +++ b/roles/testnode/tasks/apt_systems.yml @@ -8,3 +8,44 @@ include: apt/packages.yml tags: - packages + +# This was ported directly from chef. I was unable to figure out a better way +# to do this, but it seems to just be adding the user_xattr option to the root filesystem mount. +# I believe perl was used here initially because the mount resources provided by chef and ansible +# require both the name (i.e. /) and the source (UUID="") to ensure it's editing the correct line +# in /etc/fstab. This won't work for us because the root file system source (UUID or label) is different depending +# on the image used to create this node (downburst and cobbler use different images). +- name: Use perl to add user_xattr to the root mount options in fstab. + command: + perl -pe 'if (m{^([^#]\S*\s+/\s+\S+\s+)(\S+)(\s+.*)$}) { $_="$1$2,user_xattr$3\n" unless $2=~m{(^|,)user_xattr(,|$)}; }' -i.bak /etc/fstab + args: + creates: /etc/fstab.bak + register: add_user_xattr + +- name: Enable xattr for this boot. + command: + mount -o remount,user_xattr / + when: add_user_xattr|changed + +- name: Upload /etc/fuse.conf. + template: + src: fuse.conf + dest: /etc/fuse.conf + owner: root + group: fuse + mode: 0644 + +- name: Add teuthology user to groups fuse, kvm and disk. + user: + name: "{{ teuthology_user }}" + # group sets the primary group, while groups just adds + # the user to the specified group or groups. + groups: fuse,kvm,disk + append: yes + +- include: nagios.yml + tags: + - nagios + +- include: static_ip.yml + when: "'vps' not in group_names" diff --git a/roles/testnode/tasks/setup-ubuntu.yml b/roles/testnode/tasks/setup-ubuntu.yml index 314873f..3f2b15c 100644 --- a/roles/testnode/tasks/setup-ubuntu.yml +++ b/roles/testnode/tasks/setup-ubuntu.yml @@ -27,40 +27,6 @@ group: root mode: 0755 -# This was ported directly from chef. I was unable to figure out a better way -# to do this, but it seems to just be adding the user_xattr option to the root filesystem mount. -# I believe perl was used here initially because the mount resources provided by chef and ansible -# require both the name (i.e. /) and the source (UUID="") to ensure it's editing the correct line -# in /etc/fstab. This won't work for us because the root file system source (UUID or label) is different depending -# on the image used to create this node (downburst and cobbler use different images). -- name: Use perl to add user_xattr to the root mount options in fstab. - command: - perl -pe 'if (m{^([^#]\S*\s+/\s+\S+\s+)(\S+)(\s+.*)$}) { $_="$1$2,user_xattr$3\n" unless $2=~m{(^|,)user_xattr(,|$)}; }' -i.bak /etc/fstab - args: - creates: /etc/fstab.bak - register: add_user_xattr - -- name: Enable xattr for this boot. - command: - mount -o remount,user_xattr / - when: add_user_xattr|changed - -- name: Upload /etc/fuse.conf. - template: - src: fuse.conf - dest: /etc/fuse.conf - owner: root - group: fuse - mode: 0644 - -- name: Add teuthology user to groups fuse, kvm and disk. - user: - name: "{{ teuthology_user }}" - # group sets the primary group, while groups just adds - # the user to the specified group or groups. - groups: fuse,kvm,disk - append: yes - - name: Enable kernel logging to console. script: scripts/kernel_logging.sh creates=/kernel-logging-setup register: kernel_logging @@ -91,10 +57,6 @@ - start ttyS2 when: ansible_hostname | search("^mira*") -- include: nagios.yml - tags: - - nagios - - name: Enable kernel modules to load at boot time. template: src: modules @@ -117,8 +79,9 @@ tags: - nfs -# is not run on virtual machines -- include: static_ip.yml +# this script was ported directly from chef. +- name: Set up static IP and 10gig interface. + script: scripts/static-ip.sh creates=/static-ip-setup when: "'vps' not in group_names" - name: Upload a lab specific base resolv.conf. diff --git a/roles/testnode/tasks/static_ip.yml b/roles/testnode/tasks/static_ip.yml index 2876055..005ab0c 100644 --- a/roles/testnode/tasks/static_ip.yml +++ b/roles/testnode/tasks/static_ip.yml @@ -6,7 +6,3 @@ regexp: "^127.0.1.1" backrefs: yes state: present - -# this script was ported directly from chef. -- name: Set up static IP and 10gig interface. - script: scripts/static-ip.sh creates=/static-ip-setup -- 2.39.5