Browse Source

Use distro packages only after they are installed

In an environment with sudo and lsyncd not already installed the pre
install tasks try to set up config files before the config directories
exist, and the tasks fail.

This patch moves the sudo and lsyncd config tasks to run after the
distro packages have been installed.

In addition, sudo is added as a required distro package for the
repo server.

Change-Id: Iab09b732d63d007c1d638ec9dc35834e564e5ce5
changes/69/613069/2
Jonathan Rosser 7 months ago
parent
commit
467f8e3080
5 changed files with 17 additions and 14 deletions
  1. 14
    0
      tasks/repo_install.yml
  2. 0
    14
      tasks/repo_pre_install.yml
  3. 1
    0
      vars/debian.yml
  4. 1
    0
      vars/redhat.yml
  5. 1
    0
      vars/suse.yml

+ 14
- 0
tasks/repo_install.yml View File

@@ -64,6 +64,20 @@
64 64
   retries: 5
65 65
   delay: 5
66 66
 
67
+# This is so that the master repo server can perform pre and post rsync tasks
68
+# which may include stopping nginx on the slaves while data is syncing.
69
+- name: Allow nginx user to stop/start nginx via sudo
70
+  copy:
71
+    content: "nginx ALL=NOPASSWD: {{ repo_service_home_folder }}/repo/repo_prepost_cmd.sh\n"
72
+    dest: /etc/sudoers.d/nginx
73
+
74
+- name: Drop rsyncd configuration file(s)
75
+  copy:
76
+    src: "rsync.defaults"
77
+    dest: "/etc/default/rsync"
78
+  notify:
79
+    - reload rsyncd
80
+
67 81
 # TODO(odyssey4me):
68 82
 # The following two tasks only applies to Pike->Queens upgrades,
69 83
 # so they can be removed in Rocky. See:

+ 0
- 14
tasks/repo_pre_install.yml View File

@@ -13,20 +13,6 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
-# This is so that the master repo server can perform pre and post rsync tasks
17
-# which may include stopping nginx on the slaves while data is syncing.
18
-- name: Allow nginx user to stop/start nginx via sudo
19
-  copy:
20
-    content: "nginx ALL=NOPASSWD: {{ repo_service_home_folder }}/repo/repo_prepost_cmd.sh\n"
21
-    dest: /etc/sudoers.d/nginx
22
-
23
-- name: Drop rsyncd configuration file(s)
24
-  copy:
25
-    src: "rsync.defaults"
26
-    dest: "/etc/default/rsync"
27
-  notify:
28
-    - reload rsyncd
29
-
30 16
 - name: create the system group
31 17
   group:
32 18
     name: "{{ repo_service_group_name }}"

+ 1
- 0
vars/debian.yml View File

@@ -26,6 +26,7 @@ repo_server_distro_packages:
26 26
   - nginx-extras
27 27
   - openssh-server
28 28
   - rsync
29
+  - sudo
29 30
 
30 31
 repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf.lua
31 32
 repo_lsyncd_defaults_file: /etc/default/lsyncd

+ 1
- 0
vars/redhat.yml View File

@@ -28,6 +28,7 @@ repo_server_distro_packages:
28 28
   - nginx
29 29
   - openssh-server
30 30
   - rsync
31
+  - sudo
31 32
 
32 33
 repo_lsyncd_config_file: /etc/lsyncd.conf
33 34
 repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd

+ 1
- 0
vars/suse.yml View File

@@ -27,6 +27,7 @@ repo_server_distro_packages:
27 27
   - nginx
28 28
   - openssh
29 29
   - rsync
30
+  - sudo
30 31
 
31 32
 repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf
32 33
 repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd

Loading…
Cancel
Save