2021-09-06 02:54:48 +00:00
|
|
|
---
|
2021-09-09 01:07:14 +00:00
|
|
|
- name: Group hosts by platform
|
|
|
|
hosts: all
|
|
|
|
tags:
|
|
|
|
- always
|
|
|
|
pre_tasks:
|
|
|
|
- include_tasks: tasks/meta/runtime-group-determination.yaml
|
|
|
|
|
|
|
|
|
2021-09-06 02:54:48 +00:00
|
|
|
- name: Bootstrap remote ansible environment
|
2021-09-09 01:07:14 +00:00
|
|
|
hosts: linux
|
2021-11-06 01:53:47 +00:00
|
|
|
gather_facts: false
|
2021-09-06 02:54:48 +00:00
|
|
|
tags:
|
|
|
|
- always
|
|
|
|
tasks:
|
2021-11-06 01:53:47 +00:00
|
|
|
- include_tasks: tasks/meta/bootstrap-remote-env.yaml
|
2021-09-06 02:54:48 +00:00
|
|
|
|
|
|
|
|
2021-11-06 01:53:47 +00:00
|
|
|
- name: Configure common settings
|
2021-09-09 01:07:14 +00:00
|
|
|
hosts: linux
|
2021-11-06 01:53:47 +00:00
|
|
|
gather_facts: false
|
2021-09-06 03:19:41 +00:00
|
|
|
vars_files:
|
|
|
|
- vars/packages.yaml
|
2021-09-06 02:54:48 +00:00
|
|
|
tasks:
|
|
|
|
- name: Set hostname
|
|
|
|
become: true
|
|
|
|
ansible.builtin.hostname:
|
2021-11-06 03:11:45 +00:00
|
|
|
name: "{{ skylab_networking.hostname | default(inventory_hostname) }}"
|
2021-09-06 02:54:48 +00:00
|
|
|
use: systemd
|
|
|
|
|
2021-11-06 01:53:47 +00:00
|
|
|
- name: Install global bash config
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: global.sh
|
|
|
|
dest: /etc/profile.d/ZZ-skylab-global.sh
|
|
|
|
owner: root
|
|
|
|
group: "{{ ansible_user }}"
|
|
|
|
mode: 0644
|
|
|
|
|
2021-11-06 04:05:48 +00:00
|
|
|
- name: Disable case-sensitive tab-completion
|
|
|
|
become: true
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
line: set completion-ignore-case On
|
|
|
|
path: /etc/inputrc
|
|
|
|
state: present
|
|
|
|
create: true
|
|
|
|
|
2021-09-06 02:54:48 +00:00
|
|
|
- name: Install EPEL repository config
|
|
|
|
when: ansible_distribution == "Rocky"
|
|
|
|
become: true
|
|
|
|
ansible.builtin.yum_repository:
|
|
|
|
name: epel
|
|
|
|
description: Extra Packages for Enterprise Linux
|
|
|
|
baseurl: https://download.fedoraproject.org/pub/epel/$releasever{{ '/Everything' if ansible_distribution_major_version == '8' else '' }}/$basearch/
|
|
|
|
|
|
|
|
- name: Install EPEL GPG key
|
|
|
|
when: ansible_distribution == "Rocky"
|
|
|
|
become: true
|
|
|
|
ansible.builtin.rpm_key:
|
|
|
|
state: present
|
|
|
|
key: https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
|
|
|
|
|
2021-09-06 03:19:41 +00:00
|
|
|
- name: Install universal packages
|
|
|
|
when: ansible_distribution == "Rocky"
|
|
|
|
become: true
|
|
|
|
ansible.builtin.dnf:
|
|
|
|
name: "{{ skylab_packages_global + skylab_packages_rocky }}"
|
|
|
|
state: present
|
2021-11-06 02:40:57 +00:00
|
|
|
update_cache: true
|
2021-09-06 03:19:41 +00:00
|
|
|
|
2021-09-06 04:45:55 +00:00
|
|
|
|
2021-11-06 01:53:47 +00:00
|
|
|
- import_playbook: update.yaml
|
2021-09-06 04:45:55 +00:00
|
|
|
|
|
|
|
|
2021-11-06 01:53:47 +00:00
|
|
|
- import_playbook: configure.yaml
|