Add compatibility for AmazonLinux.

Ansible identifies AmazonLinux as:
  ansible_os_family: "RedHat"
  ansible_distribution_major_version == "NA"

But it is seemingly otherwise indistinguishable from RedHat / CentOS.

This sets the correct variables for packages, services, etc, which
differ from RHEL / CentOS.
This commit is contained in:
Maik Glatki 2017-04-03 09:42:39 +00:00
parent 9e4be6c2c6
commit 73bd75f4b4
2 changed files with 23 additions and 0 deletions

View file

@ -3,6 +3,11 @@
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
# If AmazonLinuxm include needed variables.
- name: Include OS-specific variables.
include_vars: "AmazonLinux.yml"
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA"
- name: Define apache_packages.
set_fact:
apache_packages: "{{ __apache_packages | list }}"

18
vars/AmazonLinux.yml Normal file
View file

@ -0,0 +1,18 @@
---
apache_service: httpd
apache_daemon: httpd
apache_daemon_path: /usr/sbin/
apache_server_root: /etc/httpd
apache_conf_path: /etc/httpd/conf.d
apache_vhosts_version: "2.4"
__apache_packages:
- httpd24
- httpd24-devel
- mod24_ssl
- openssh
apache_ports_configuration_items:
- regexp: "^Listen "
line: "Listen {{ apache_listen_port }}"