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
This commit is contained in:
Jonathan Rosser 2018-10-24 16:08:23 +01:00
parent 8350c74fb8
commit 467f8e3080
5 changed files with 17 additions and 14 deletions

View File

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

View File

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

View File

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

View File

@ -28,6 +28,7 @@ repo_server_distro_packages:
- nginx
- openssh-server
- rsync
- sudo
repo_lsyncd_config_file: /etc/lsyncd.conf
repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd

View File

@ -27,6 +27,7 @@ repo_server_distro_packages:
- nginx
- openssh
- rsync
- sudo
repo_lsyncd_config_file: /etc/lsyncd/lsyncd.conf
repo_lsyncd_defaults_file: /etc/sysconfig/lsyncd