Merge pull request #705 from vwfs/centos7-azure

Better support for CentOS 7 on Azure
This commit is contained in:
Bogdan Dobrelya
2016-12-13 10:36:58 +01:00
committed by GitHub
7 changed files with 68 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
---
- name: Check presence of fastestmirror.conf
stat: path=/etc/yum/pluginconf.d/fastestmirror.conf
register: fastestmirror
# fastestmirror plugin actually slows down Ansible deployments
- name: Disable fastestmirror plugin
lineinfile:
dest: /etc/yum/pluginconf.d/fastestmirror.conf
regexp: "^enabled=.*"
line: "enabled=0"
state: present
when: fastestmirror.stat.exists

View File

@@ -3,4 +3,9 @@
when: bootstrap_os == "ubuntu"
- include: bootstrap-coreos.yml
when: bootstrap_os == "coreos"
when: bootstrap_os == "coreos"
- include: bootstrap-centos.yml
when: bootstrap_os == "centos"
- include: setup-pipelining.yml

View File

@@ -0,0 +1,6 @@
---
# Remove requiretty to make ssh pipelining work
- name: Remove require tty
lineinfile: regexp="^\w+\s+requiretty" dest=/etc/sudoers state=absent

View File

@@ -0,0 +1,25 @@
---
# Running growpart seems to be only required on Azure, as other Cloud Providers do this at boot time
- name: install growpart
package: name=cloud-utils-growpart state=latest
- name: check if growpart needs to be run
command: growpart -N /dev/sda 1
failed_when: False
changed_when: "'NOCHANGE:' not in growpart_needed.stdout"
register: growpart_needed
- name: check fs type
command: file -Ls /dev/sda1
changed_when: False
register: fs_type
- name: run growpart
command: growpart /dev/sda 1
when: growpart_needed.changed
- name: run xfs_growfs
command: xfs_growfs /dev/sda1
when: growpart_needed.changed and 'XFS' in fs_type.stdout

View File

@@ -180,3 +180,15 @@
- include: resolvconf.yml
tags: [bootstrap-os, resolvconf]
- name: Check if we are running inside a Azure VM
stat: path=/var/lib/waagent/
register: azure_check
tags: bootstrap-os
- include: growpart-azure-centos-7.yml
when: azure_check.stat.exists and
ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7
tags: bootstrap-os