2015-12-30 16:11:33 +00:00
|
|
|
---
|
2015-12-30 21:15:18 +00:00
|
|
|
- name: "Identify init system"
|
|
|
|
shell: >
|
2015-12-22 10:50:55 +00:00
|
|
|
$(pgrep systemd > /dev/null && systemctl status > /dev/null);
|
|
|
|
if [ $? -eq 0 ] ; then
|
2015-12-30 21:15:18 +00:00
|
|
|
echo systemd;
|
2015-12-31 13:07:02 +00:00
|
|
|
else
|
|
|
|
echo sysvinit;
|
2015-12-30 21:15:18 +00:00
|
|
|
fi
|
|
|
|
always_run: True
|
|
|
|
register: init_system_output
|
2015-12-31 13:54:15 +00:00
|
|
|
changed_when: False
|
2015-12-30 16:11:33 +00:00
|
|
|
|
2015-12-30 21:15:18 +00:00
|
|
|
- set_fact:
|
|
|
|
init_system: "{{ init_system_output.stdout }}"
|
|
|
|
|
2015-12-31 13:07:02 +00:00
|
|
|
- name: Install packages requirements
|
|
|
|
action:
|
|
|
|
module: "{{ ansible_pkg_mgr }}"
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: latest
|
|
|
|
with_items: common_required_pkgs
|
|
|
|
|
2015-12-30 21:15:18 +00:00
|
|
|
- name: Install debian packages requirements
|
|
|
|
apt:
|
2015-12-30 16:11:33 +00:00
|
|
|
name: "{{ item }}"
|
2015-12-30 21:15:18 +00:00
|
|
|
state: latest
|
|
|
|
when: ansible_os_family == "Debian"
|
2015-12-31 13:07:02 +00:00
|
|
|
with_items: debian_required_pkgs
|
|
|
|
|
|
|
|
- name: Install redhat packages requirements
|
|
|
|
action:
|
|
|
|
module: "{{ ansible_pkg_mgr }}"
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: latest
|
|
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
with_items: rh_required_pkgs
|
2015-12-30 21:15:18 +00:00
|
|
|
|
|
|
|
- include: python-bootstrap.yml
|
|
|
|
when: ansible_os_family not in [ "Debian", "RedHat" ]
|