Fix myriad bugs in playbooks
Update inventory
This commit is contained in:
@@ -1,37 +1,43 @@
|
||||
---
|
||||
- include_playbook: dependencies.yml
|
||||
- import_playbook: dependencies.yml
|
||||
|
||||
|
||||
- hosts: all
|
||||
name: Init
|
||||
tasks:
|
||||
- name: Check system compatibility
|
||||
when: ansible_distribution != "CentOS" and ansible_distribution != "Red Hat Enterprise Linux" and ansible_distribution != "Fedora"
|
||||
meta: end_play
|
||||
debug:
|
||||
msg: "Standard configuration deployment is only supported on Fedora 28/29, Centos 7.5, and RHEL"
|
||||
|
||||
- name: Set hostname
|
||||
become: true
|
||||
hostname:
|
||||
name: "{{ default_host if default_host is defined else inventory_hostname }}"
|
||||
|
||||
- name: Install MOTD
|
||||
- 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/motd
|
||||
dest: /etc/issue.net
|
||||
mode: 0644
|
||||
|
||||
- name: Install global bashrc
|
||||
- name: Configure SSH banner
|
||||
become: true
|
||||
template:
|
||||
src: bashrc.j2
|
||||
dest: /etc/profile.d/30-omni-bashrc.sh
|
||||
mode: 0644
|
||||
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
|
||||
@@ -57,20 +63,18 @@
|
||||
when: ansible_distribution == "Fedora"
|
||||
# - import_tasks: common/debian/networkd.yml
|
||||
# when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"
|
||||
- name: Configure systemd-networkd
|
||||
when: enable_networkd == true
|
||||
- import_tasks: common/networkd.yml
|
||||
|
||||
- import_tasks: tasks/networkd.yml
|
||||
|
||||
|
||||
- hosts: all
|
||||
name: Register static DHCP entries
|
||||
- import_playbook: update-users-local.yml
|
||||
|
||||
|
||||
- hosts: vms
|
||||
name: Install ovirt agent
|
||||
tasks:
|
||||
- name: Install static DHCP leases
|
||||
delegate_to: {{ router.address }}
|
||||
when: networking is defined
|
||||
edgeos_config:
|
||||
save: true
|
||||
lines:
|
||||
- set service dhcp-server shared-network-name {{ router.static.server }} subnet {{ router.static.subnet }} static-mapping {{ item.alias | default(inventory_hostname) }} mac-address {{ item.mac }}
|
||||
- set service dhcp-server shared-network-name {{ router.static.server }} subnet {{ router.static.subnet }} static-mapping {{ item.alias | default(inventory_hostname) }} ip-address {{ item.address }}
|
||||
with_dict: "{{ networking }}"
|
||||
- name: Install ovirt-agent
|
||||
become: true
|
||||
yum:
|
||||
name: ovirt-guest-agent
|
||||
state: latest
|
||||
|
||||
Reference in New Issue
Block a user