81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
---
|
|
- import_playbook: dependencies.yml
|
|
|
|
|
|
- hosts: all
|
|
name: Init
|
|
tasks:
|
|
- name: Set hostname
|
|
become: true
|
|
hostname:
|
|
name: "{{ default_host if default_host is defined else inventory_hostname }}"
|
|
|
|
- name: Install global bashrc
|
|
become: true
|
|
copy:
|
|
src: bashrc.sh
|
|
dest: /etc/profile.d/30-omni-bashrc.sh
|
|
mode: 0644
|
|
|
|
- name: Install SSH Banner
|
|
become: true
|
|
template:
|
|
src: motd.j2
|
|
dest: /etc/issue.net
|
|
mode: 0644
|
|
|
|
- name: Configure SSH banner
|
|
become: true
|
|
lineinfile:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: '#Banner none'
|
|
line: 'Banner /etc/issue.net'
|
|
|
|
|
|
- hosts: all
|
|
name: System packages
|
|
tasks:
|
|
- name: Load package variables
|
|
include_vars:
|
|
file: packages.yml
|
|
- import_tasks: tasks/centos/repositories.yml
|
|
when: ansible_distribution == "CentOS"
|
|
- import_tasks: tasks/centos/packages.yml
|
|
when: ansible_distribution == "CentOS"
|
|
- import_tasks: tasks/fedora/packages.yml
|
|
when: ansible_distribution == "Fedora"
|
|
# - import_tasks: tasks/debian/packages.yml
|
|
# when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"
|
|
|
|
|
|
- import_playbook: update-system.yml
|
|
|
|
|
|
- hosts: all
|
|
name: Replace NetworkManager with systemd-networkd
|
|
tasks:
|
|
- name: Install systemd-networkd
|
|
when: enable_networkd == true
|
|
block:
|
|
- import_tasks: tasks/centos/networkd.yml
|
|
when: ansible_distribution == "CentOS"
|
|
- import_tasks: tasks/fedora/networkd.yml
|
|
when: ansible_distribution == "Fedora"
|
|
# - import_tasks: common/debian/networkd.yml
|
|
# when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"
|
|
|
|
- import_tasks: tasks/networkd.yml
|
|
|
|
|
|
- import_playbook: update-users-local.yml
|
|
|
|
|
|
- hosts: vms
|
|
name: Install ovirt agent
|
|
tasks:
|
|
- name: Install ovirt-agent
|
|
become: true
|
|
yum:
|
|
name: ovirt-guest-agent
|
|
state: latest
|