Allow deployers to configure yum fastestmirror

This patch uses the new ``openstack_hosts_enable_yum_fastestmirror``
variable to determine whether yum's fastestmirror plugin should be
enabled.

Depends-On: I8b2a1db084ab47962dbef8c6b037836f44b4ed46
Change-Id: Id340ac48a551081031b14804d376e6e5d744fa0d
This commit is contained in:
Major Hayden 2018-02-13 16:03:54 -06:00
parent 3e64936b22
commit 3d6612b821
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
3 changed files with 25 additions and 0 deletions

View File

@ -147,3 +147,6 @@ opensuse_obs_cloud_repo_url: "{{ opensuse_mirror_obs }}/repositories/Cloud:/Open
# Keep a history of systemd journals on disk after reboots
openstack_host_keep_journals: yes
# Enable/Disable the yum fastestmirror plugin
openstack_hosts_enable_yum_fastestmirror: yes

View File

@ -0,0 +1,7 @@
---
features:
- |
Deployers of CentOS 7 environments can use the
``openstack_hosts_enable_yum_fastestmirror`` variable to enable or disable
yum's fastestmirror plugin. The default setting of ``yes`` ensures that
fastestmirror is enabled.

View File

@ -13,6 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Check to see if yum's fastestmirror plugin is present
stat:
path: /etc/yum/pluginconf.d/fastestmirror.conf
register: fastestmirror_plugin_check
- name: Configure yum's fastestmirror plugin
ini_file:
path: /etc/yum/pluginconf.d/fastestmirror.conf
section: main
option: enabled
value: "{{ (openstack_hosts_enable_yum_fastestmirror | bool) | ternary('1', '0') }}"
no_extra_spaces: yes
when:
- fastestmirror_plugin_check.stat.exists
- name: Disable requiretty for root sudo on centos
template:
dest: /etc/sudoers.d/openstack-ansible