summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Rosser <jonathan.rosser@rd.bbc.co.uk>2018-10-24 16:08:23 +0100
committerJonathan Rosser <jonathan.rosser@rd.bbc.co.uk>2018-10-25 12:08:26 +0000
commit467f8e30805301645956f1e3d72a933cf47495b1 (patch)
treea837988bd6261b5a525cf6316aa7de45b6db7ce3
parent8350c74fb84ce71cd754be4aa99953d8d59df1e6 (diff)
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
Notes
Notes (review): Code-Review+2: Jesse Pretorius (odyssey4me) <jesse.pretorius@rackspace.co.uk> Code-Review+2: Markos Chandras (hwoarang) <mchandras@suse.de> Workflow+1: Markos Chandras (hwoarang) <mchandras@suse.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 25 Oct 2018 16:59:23 +0000 Reviewed-on: https://review.openstack.org/613069 Project: openstack/openstack-ansible-repo_server Branch: refs/heads/master
-rw-r--r--tasks/repo_install.yml14
-rw-r--r--tasks/repo_pre_install.yml14
-rw-r--r--vars/debian.yml1
-rw-r--r--vars/redhat.yml1
-rw-r--r--vars/suse.yml1
5 files changed, 17 insertions, 14 deletions
diff --git a/tasks/repo_install.yml b/tasks/repo_install.yml
index 70797ca..f79ceaa 100644
--- a/tasks/repo_install.yml
+++ b/tasks/repo_install.yml
@@ -64,6 +64,20 @@
64 retries: 5 64 retries: 5
65 delay: 5 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# TODO(odyssey4me): 81# TODO(odyssey4me):
68# The following two tasks only applies to Pike->Queens upgrades, 82# The following two tasks only applies to Pike->Queens upgrades,
69# so they can be removed in Rocky. See: 83# so they can be removed in Rocky. See:
diff --git a/tasks/repo_pre_install.yml b/tasks/repo_pre_install.yml
index e065977..a6f1381 100644
--- a/tasks/repo_pre_install.yml
+++ b/tasks/repo_pre_install.yml
@@ -13,20 +13,6 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 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- name: create the system group 16- name: create the system group
31 group: 17 group:
32 name: "{{ repo_service_group_name }}" 18 name: "{{ repo_service_group_name }}"
diff --git a/vars/debian.yml b/vars/debian.yml
index 42f2fbf..5817c34 100644
--- a/vars/debian.yml
+++ b/vars/debian.yml
@@ -26,6 +26,7 @@ repo_server_distro_packages:
26 - nginx-extras 26 - nginx-extras
27 - openssh-server 27 - openssh-server
28 - rsync 28 - rsync
29 - sudo
29 30
30repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf.lua 31repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf.lua
31repo_lsyncd_defaults_file: /etc/default/lsyncd 32repo_lsyncd_defaults_file: /etc/default/lsyncd
diff --git a/vars/redhat.yml b/vars/redhat.yml
index 2064505..569f9ba 100644
--- a/vars/redhat.yml
+++ b/vars/redhat.yml
@@ -28,6 +28,7 @@ repo_server_distro_packages:
28 - nginx 28 - nginx
29 - openssh-server 29 - openssh-server
30 - rsync 30 - rsync
31 - sudo
31 32
32repo_lsyncd_config_file: /etc/lsyncd.conf 33repo_lsyncd_config_file: /etc/lsyncd.conf
33repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd 34repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd
diff --git a/vars/suse.yml b/vars/suse.yml
index 52f0626..a06b442 100644
--- a/vars/suse.yml
+++ b/vars/suse.yml
@@ -27,6 +27,7 @@ repo_server_distro_packages:
27 - nginx 27 - nginx
28 - openssh 28 - openssh
29 - rsync 29 - rsync
30 - sudo
30 31
31repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf 32repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf
32repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd 33repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd