]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Made the teuthology user a var
authorAndrew Schoen <aschoen@redhat.com>
Fri, 20 Mar 2015 14:52:02 +0000 (09:52 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 24 Mar 2015 00:18:51 +0000 (17:18 -0700)
This will allow us to more easily change the user teuthology uses to run
tests against these nodes in the future.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/common/defaults/main.yml
roles/common/tasks/main.yml
roles/common/tasks/pip.yml
roles/common/tasks/redhat/rhel_7.0.yml
roles/common/tasks/setup-redhat.yml
roles/common/templates/cpan_config.pm
roles/common/templates/security_limits.conf
roles/common/templates/sudoers

index 4c18529bdc105150f586661982c788071163087f..fde3009f613731a9e3d417b20a901f5244ecddee 100644 (file)
@@ -37,3 +37,6 @@ yum_repos: {}
 # packages are defined in the pkg manager
 # specific var files.
 packages: []
+
+# the user teuthology will use
+teuthology_user: "ubuntu"
index 15b92e606842d94826477ac948c5e868d0f34005..ec883bf870cd6299ef60edc1969f7fc5c9665514 100644 (file)
@@ -7,10 +7,10 @@
 # configure pip to use our mirror
 - include: pip.yml
 
-- name: Set a high max open files limit
+- name: Set a high max open files limit for the teuthology user.
   template:
     src: security_limits.conf
-    dest: /etc/security/limits.d/ubuntu.conf
+    dest: "/etc/security/limits.d/{{ teuthology_user }}.conf"
     owner: root
     group: root
     mode: 0755
index 4aa70d0181d3388a941e81586577b6ce5ad71095..0fe23ab6b3c1d013b5d2a37f8f04d52d0fc03d11 100644 (file)
@@ -1,16 +1,16 @@
 ---
-- name: Create /home/ubuntu/.pip
+- name: Create the .pip directory for the teuthology user.
   file:
-    path: /home/ubuntu/.pip
-    owner: ubuntu
-    group: ubuntu
+    path: "/home/{{ teuthology_user }}/.pip"
+    owner: "{{ teuthology_user }}"
+    group: "{{ teuthology_user }}"
     mode: 0644
     state: directory
 
 - name: Create pip.conf and configure it to use our mirror
   template:
     src: pip.conf
-    dest: /home/ubuntu/.pip/pip.conf
-    owner: ubuntu
-    group: ubuntu
+    dest: "/home/{{ teuthology_user }}/.pip/pip.conf"
+    owner: "{{ teuthology_user }}"
+    group: "{{ teuthology_user }}"
     mode: 0644
index 458a2b4cdfc30883a03031d2a04511ffdd99b862..a1c09e09d7960778d80209c074664f57e28de6c2 100644 (file)
      name: "{{ new_hostname.stdout }}"
   when: existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
 
-- name: Add ubuntu CPAN config directory.
+- name: Add CPAN config directory for the teuthology user.
   file:
-    path: /home/ubuntu/.cpan/CPAN/
-    owner: ubuntu
-    group: ubuntu
+    path: "/home/{{ teuthology_user }}/.cpan/CPAN/"
+    owner: "{{ teuthology_user }}"
+    group: "{{ teuthology_user }}"
     mode: 0755
     recurse: yes
     state: directory
 
-- name: Add root CPAN config directory.
+- name: Add CPAN config directory for the root user.
   file:
     path: /root/.cpan/CPAN/
     owner: root
     recurse: yes
     state: directory
 
-- name: Upload CPAN config for ubuntu.
+- name: Upload CPAN config for the teuthology user.
   template:
     src: ../../templates/cpan_config.pm
-    dest: /home/ubuntu/.cpan/CPAN/MyConfig.pm
-    owner: ubuntu
-    group: ubuntu
+    dest: "/home/{{ teuthology_user }}/.cpan/CPAN/MyConfig.pm"
+    owner: "{{ teuthology_user }}"
+    group: "{{ teuthology_user }}"
     mode: 0755
 
 - name: Upload CPAN config for root.
index b25edd7ffb279ee0ba426e4ba80b10475904c8c4..539958416c3037a4890ca7e6ad1b81d25d545c25 100644 (file)
@@ -32,9 +32,9 @@
     path: /etc/fuse.conf
     mode: 0644
 
-- name: Add user ubuntu to group kvm
+- name: Add the teuthology user to group kvm
   user:
-    name: ubuntu
+    name: "{{ teuthology_user }}"
     group: kvm
 
 - name: Upload rhel version specific sshd_config.
index b2953067ef0a12bca4dca3baaf462bee07e3a439..1d33d94f040b90b239b0f287d0951d803ce96924 100644 (file)
@@ -3,7 +3,7 @@ $CPAN::Config = {
   'applypatch' => q[],
   'auto_commit' => q[0],
   'build_cache' => q[100],
-  'build_dir' => q[/home/ubuntu/.cpan/build],
+  'build_dir' => q[/home/{{ teuthology_user }}/.cpan/build],
   'build_dir_reuse' => q[0],
   'build_requires_install_policy' => q[yes],
   'bzip2' => q[/bin/bzip2],
@@ -12,20 +12,20 @@ $CPAN::Config = {
   'colorize_output' => q[0],
   'commandnumber_in_prompt' => q[1],
   'connect_to_internet_ok' => q[1],
-  'cpan_home' => q[/home/ubuntu/.cpan],
+  'cpan_home' => q[/home/{{ teuthology_user }}/.cpan],
   'ftp_passive' => q[1],
   'ftp_proxy' => q[],
   'getcwd' => q[cwd],
   'gpg' => q[/usr/bin/gpg],
   'gzip' => q[/bin/gzip],
   'halt_on_failure' => q[0],
-  'histfile' => q[/home/ubuntu/.cpan/histfile],
+  'histfile' => q[/home/{{ teuthology_user }}/.cpan/histfile],
   'histsize' => q[100],
   'http_proxy' => q[],
   'inactivity_timeout' => q[0],
   'index_expire' => q[1],
   'inhibit_startup_message' => q[0],
-  'keep_source_where' => q[/home/ubuntu/.cpan/sources],
+  'keep_source_where' => q[/home/{{ teuthology_user }}/.cpan/sources],
   'load_module_verbosity' => q[none],
   'make' => q[/usr/bin/make],
   'make_arg' => q[],
@@ -42,7 +42,7 @@ $CPAN::Config = {
   'perl5lib_verbosity' => q[none],
   'prefer_external_tar' => q[1],
   'prefer_installer' => q[MB],
-  'prefs_dir' => q[/home/ubuntu/.cpan/prefs],
+  'prefs_dir' => q[/home/{{ teuthology_user }}/.cpan/prefs],
   'prerequisites_policy' => q[follow],
   'scan_cache' => q[atstart],
   'shell' => q[/bin/bash],
index 2dd4f3ee155ce3a4984070eddb885931c3b88b86..1c515b24a408b510756eed1410e72d4e3542a4ec 100644 (file)
@@ -1,2 +1,2 @@
 # {{ ansible_managed }}
-ubuntu hard nofile 16384
+{{ teuthology_user }} hard nofile 16384
index 8d107bf270fd60ba5b556c4d23840d84bfca28b7..571cb9809a2d7b8ea44d4cc8e4e760d85fccbf56 100755 (executable)
@@ -42,4 +42,4 @@ root  ALL=(ALL)       ALL
 ## Allows people in group wheel to run all commands
 %wheel ALL=(ALL)       ALL
 
-ubuntu ALL=(ALL) NOPASSWD:ALL
+{{ teuthology_user }} ALL=(ALL) NOPASSWD:ALL