4d3f6c6533
install required packages before common roles/kubernetes/preinstall/tasks/main.yml
79 lines
2.2 KiB
YAML
79 lines
2.2 KiB
YAML
---
|
|
- include: gitinfos.yml
|
|
when: run_gitinfos
|
|
|
|
- name: gather os specific variables
|
|
include_vars: "{{ item }}"
|
|
with_first_found:
|
|
- files:
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
|
|
- "{{ ansible_distribution|lower }}.yml"
|
|
- "{{ ansible_os_family|lower }}.yml"
|
|
- defaults.yml
|
|
paths:
|
|
- ../vars
|
|
|
|
- name: "Identify init system"
|
|
shell: >
|
|
$(pgrep systemd > /dev/null && systemctl status network.target > /dev/null);
|
|
if [ $? -eq 0 ] ; then
|
|
echo systemd;
|
|
else
|
|
echo sysvinit;
|
|
fi
|
|
always_run: True
|
|
register: init_system_output
|
|
changed_when: False
|
|
tags: always
|
|
|
|
- set_fact:
|
|
init_system: "{{ init_system_output.stdout }}"
|
|
always_run: True
|
|
tags: always
|
|
|
|
- name: Update package management cache (APT)
|
|
apt: update_cache=yes
|
|
when: ansible_pkg_mgr == 'apt'
|
|
|
|
- name: Update package management cache (YUM)
|
|
yum: update_cache=yes name='*'
|
|
when: ansible_pkg_mgr == 'yum'
|
|
|
|
- name: Install python-apt for Debian distribs
|
|
shell: apt-get install -y python-apt
|
|
when: ansible_os_family == "Debian"
|
|
changed_when: False
|
|
|
|
- name: Install python-dnf for latest RedHat versions
|
|
shell: dnf install -y python-dnf yum
|
|
when: ansible_distribution == "Fedora" and
|
|
ansible_distribution_major_version > 21
|
|
changed_when: False
|
|
|
|
- name: Install epel-release for RedHat and CentOS distribs
|
|
action:
|
|
module: "{{ ansible_pkg_mgr }}"
|
|
name: "epel-release"
|
|
state: latest
|
|
when: ansible_distribution == "RedHat" or
|
|
ansible_distribution == "CentOS"
|
|
|
|
- name: Install packages requirements
|
|
action:
|
|
module: "{{ ansible_pkg_mgr }}"
|
|
name: "{{ item }}"
|
|
state: latest
|
|
with_items: "{{required_pkgs | union(common_required_pkgs)}}"
|
|
|
|
# Todo : selinux configuration
|
|
- name: Set selinux policy to permissive
|
|
selinux: policy=targeted state=permissive
|
|
when: ansible_os_family == "RedHat"
|
|
changed_when: False
|
|
|
|
- include: etchosts.yml
|
|
|
|
- include: python-bootstrap.yml
|
|
when: ansible_os_family not in [ "Debian", "RedHat" ]
|