ansible/playbooks/groups/virthost.yml
Kevin Fenzi 2cc8fabdbf virthost: no collectd client packages on rhel10 yet
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-05-30 20:06:07 -07:00

56 lines
2 KiB
YAML

# create a new virthost server system
# NOTE: should be used with --limit most of the time
# NOTE: most of these vars_path come from group_vars/backup_server or from hostvars
---
- import_playbook: "/srv/web/infra/ansible/playbooks/include/happy_birthday.yml"
vars:
myhosts: "virthost:bvirthost:buildvmhost:colo_virt"
- name: make virthost server system
hosts: virthost:bvirthost:buildvmhost:colo_virt
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
pre_tasks:
- include_vars: dir=/srv/web/infra/ansible/vars/all/ ignore_files=README
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
- name: override nbde_client-network-flush to work around bug
ansible.builtin.copy:
src: "{{ files }}/common/nbde_client-network-flush"
dest: /usr/bin/nbde_client-network-flush
owner: root
group: root
mode: 755
- name: tell NetworkManager we don't want any auto connections
ansible.builtin.copy:
src: "{{ files }}/common/noautodefault.conf"
dest: /etc/NetworkManager/conf.d/noautodefault.conf
owner: root
group: root
mode: 644
roles:
- base
- {role: rkhunter, when: ansible_distribution_major_version|int < 10}
- {role: nagios_client, when: ansible_distribution_major_version|int < 10}
- {role: zabbix/zabbix_agent, when: ansible_distribution_major_version|int < 10}
- hosts
- {role: openvpn/client, when: vpn|bool}
- ipa/client
- {role: collectd/base, when: ansible_distribution_major_version|int < 10}
- {role: iscsi_client, when: "inventory_hostname.startswith(('bvmhost-x86-06', 'bvmhost-x86-07', 'bvmhost-p09')) and datacenter == 'iad2'"}
- sudo
- virthost
- {role: linux-system-roles.nbde_client, tags: ['nbde_client'], when: datacenter == 'iad2' and nbde|bool}
- {role: serial-console, when: datacenter == 'iad2' and ansible_architecture != 's390x'}
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"