diff --git a/ansible/roles/yum-cron/handlers/main.yml b/ansible/roles/yum-cron/handlers/main.yml index e55f9eaff..fc26c999e 100644 --- a/ansible/roles/yum-cron/handlers/main.yml +++ b/ansible/roles/yum-cron/handlers/main.yml @@ -4,3 +4,4 @@ service: name: yum-cron state: restarted + become: True diff --git a/ansible/roles/yum-cron/tasks/main.yml b/ansible/roles/yum-cron/tasks/main.yml index 4424c4314..3a6e63bfc 100644 --- a/ansible/roles/yum-cron/tasks/main.yml +++ b/ansible/roles/yum-cron/tasks/main.yml @@ -5,6 +5,7 @@ name: yum-cron state: present when: yum_cron_enabled + become: True - name: Replace | Enable update applying for yum-cron (CentOS) replace: @@ -14,15 +15,17 @@ when: yum_cron_enabled notify: - Restart yum-cron + become: True - name: Replace | Enable update applying for yum-cron (CentOS) replace: dest: /etc/yum/yum-cron.conf - regexp: "^update_cmd = default" + regexp: "^update_cmd = .*$" replace: "update_cmd = {{ yum_cron_update_cmd }}" when: yum_cron_enabled notify: - Restart yum-cron + become: True - name: Service | Enable yum-cron (CentOS) service: @@ -30,3 +33,4 @@ state: started enabled: yes when: yum_cron_enabled + become: True diff --git a/ansible/roles/yum/tasks/main.yml b/ansible/roles/yum/tasks/main.yml index 91f31ef28..6f96f909c 100644 --- a/ansible/roles/yum/tasks/main.yml +++ b/ansible/roles/yum/tasks/main.yml @@ -1,4 +1,6 @@ --- - include: redhat.yml - when: (ansible_os_family == "RedHat" and use_local_mirror == true) + when: + - ansible_os_family == "RedHat" + - yum_use_local_mirror diff --git a/ansible/roles/yum/tasks/redhat.yml b/ansible/roles/yum/tasks/redhat.yml index 750fbce30..d3425fdbc 100644 --- a/ansible/roles/yum/tasks/redhat.yml +++ b/ansible/roles/yum/tasks/redhat.yml @@ -5,6 +5,7 @@ dest: /etc/yum/pluginconf.d/fastestmirror.conf regexp: "enabled=1" replace: "enabled=0" + become: True - name: Template | Copy CentOS repo templates (CentOS) template: @@ -13,16 +14,18 @@ owner: root group: root mode: 0664 + become: True - name: Yum | Update cache (CentOS) yum: update_cache: yes + become: True - name: Yum | Install epel-release (CentOS) yum: name: epel-release state: installed - when: ansible_os_family == 'RedHat' + become: True - name: Template | Copy EPEL repo templates (CentOS) template: @@ -31,8 +34,9 @@ owner: root group: root mode: 0664 + become: True - name: Yum | Update cache (CentOS) yum: update_cache: yes - when: ansible_os_family == 'RedHat' + become: True diff --git a/doc/source/release-notes.rst b/doc/source/release-notes.rst index c05c2345a..40287ec92 100644 --- a/doc/source/release-notes.rst +++ b/doc/source/release-notes.rst @@ -17,6 +17,7 @@ Features * Adds support for configuration of custom fluentd filters, and additional config file templates for heat, ironic, keystone, magnum, murano, sahara, and swift in ``$KAYOBE_CONFIG_PATH/kolla/config//``. +* Adds support for specifing a local Yum mirror for package installation. Upgrade Notes ------------- diff --git a/etc/kayobe/yum-cron.yml b/etc/kayobe/yum-cron.yml index 26edba590..d237eb52d 100644 --- a/etc/kayobe/yum-cron.yml +++ b/etc/kayobe/yum-cron.yml @@ -1,4 +1,6 @@ --- +# Whether to enable Yum automatic updates. #yum_cron_enabled: false +# Command to use for Yum automatic updates. #yum_cron_update_cmd: 'security' diff --git a/etc/kayobe/yum.yml b/etc/kayobe/yum.yml index dfb37d57c..40224969c 100644 --- a/etc/kayobe/yum.yml +++ b/etc/kayobe/yum.yml @@ -2,8 +2,6 @@ # Whether or not to use a local Yum mirror. #yum_use_local_mirror: false -# Whether or not yum-cron is enabled. -#yum_cron_enabled: false # Mirror FQDN for Yum repos. #yum_centos_mirror_host: 'mirror.centos.org' # Mirror directory for Yum CentOS repos. diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 184e0ff80..c8af215a3 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -555,11 +555,11 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, * Configure a user account for use by kayobe for SSH access. * Optionally, wipe unmounted disk partitions (--wipe-disks). * Configure user accounts, group associations, and authorised SSH keys. + * Configure YUM repos. * Disable SELinux. * Configure the host's network interfaces. * Set sysctl parameters. * Disable bootstrap interface configuration. - * Configure YUM repos. * Configure NTP. * Configure LVM volumes. * Configure a user account for kolla-ansible.