2014-10-10 12:35:14 +02:00
|
|
|
---
|
|
|
|
# tasklist for setting up copr
|
|
|
|
# This is the base set of files needed for copr
|
|
|
|
|
|
|
|
|
2015-03-18 09:38:23 +01:00
|
|
|
# again to late to do it here
|
2017-10-17 17:37:03 +00:00
|
|
|
# - import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml"
|
2015-03-18 09:38:23 +01:00
|
|
|
# already included into the `base` role
|
2024-11-27 13:48:08 +10:00
|
|
|
# - import_tasks: "{{ tasks_path }}/postfix_basic.yml"
|
2015-03-18 09:38:23 +01:00
|
|
|
|
|
|
|
# To late to do it here (
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Setup correct hostname for copr machine
|
2015-03-18 09:38:23 +01:00
|
|
|
# hostname: name="{{ copr_hostbase }}.cloud.fedoraproject.org"
|
|
|
|
# # hostname: name="{{ hostbase|regex_replace('.*-$', '')}}.cloud.fedoraproject.org"
|
|
|
|
# tags:
|
|
|
|
# - config
|
2014-10-10 12:35:14 +02:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Enable epel for non-fedora hosts
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package: state=present pkg="epel-release"
|
2015-07-21 17:45:58 +02:00
|
|
|
when: ansible_distribution != 'Fedora'
|
2015-07-21 16:41:56 +02:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Copy .forward file
|
2024-12-18 08:23:28 +10:00
|
|
|
ansible.builtin.copy: src="{{ _forward_src }}" dest="/root/.forward" owner=root group=root
|
2016-02-17 09:50:06 +01:00
|
|
|
tags:
|
|
|
|
- config
|
2014-10-10 12:35:14 +02:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Deploy /etc/hosts file
|
2024-12-18 08:23:28 +10:00
|
|
|
ansible.builtin.copy: src="hosts" dest=/etc/ owner=root group=root mode=644
|
2016-02-17 09:50:06 +01:00
|
|
|
tags:
|
|
|
|
- config
|
2014-10-10 12:35:14 +02:00
|
|
|
|
2023-01-09 11:39:25 +01:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1941170
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Mask the systemd-oomd service
|
2023-01-09 11:39:25 +01:00
|
|
|
systemd:
|
|
|
|
name: systemd-oomd
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
masked: yes
|
2023-08-20 19:22:44 +02:00
|
|
|
when: ansible_distribution == 'Fedora'
|
2022-11-29 22:24:33 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Configure crond
|
2024-12-18 08:23:28 +10:00
|
|
|
ansible.builtin.copy: src=sysconfig.crond dest=/etc/sysconfig/crond
|
2025-02-07 13:51:07 +01:00
|
|
|
notify: Restart crond
|
2020-02-26 14:57:58 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Install base copr packages
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package:
|
2023-02-15 10:19:29 +01:00
|
|
|
name:
|
|
|
|
- acl # useful for ansible acl module
|
|
|
|
- bash-completion
|
|
|
|
- cronie-anacron
|
|
|
|
- ethtool
|
2024-11-27 21:22:02 +01:00
|
|
|
- node-exporter
|
2023-02-15 10:19:29 +01:00
|
|
|
- screen
|
|
|
|
- tmux
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
packages
|
2020-11-11 13:52:37 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Install rsyslog-logrotate
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package: name=rsyslog-logrotate state=present
|
2023-08-20 19:31:22 +02:00
|
|
|
when: ansible_distribution == 'Fedora'
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Configure anacrond to not send mails to root user
|
2020-02-26 14:57:58 +01:00
|
|
|
lineinfile: dest=/etc/anacrontab
|
|
|
|
backup=yes
|
|
|
|
state=present
|
2023-02-21 09:08:23 +01:00
|
|
|
line='MAILTO=copr-team@redhat.com'
|
2020-02-26 14:57:58 +01:00
|
|
|
regexp="^MAILTO"
|
2025-02-07 13:51:07 +01:00
|
|
|
notify: Restart crond
|
2019-08-04 20:57:28 +02:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Override the default rsyslog logrotate file
|
2024-12-18 08:23:28 +10:00
|
|
|
ansible.builtin.copy: src=syslog-logrotate dest=/etc/logrotate.d/rsyslog
|
2019-04-02 10:27:12 +02:00
|
|
|
tags:
|
2023-02-15 10:19:29 +01:00
|
|
|
- logrotate
|
2023-08-20 19:31:22 +02:00
|
|
|
when: ansible_distribution == 'Fedora'
|
2019-02-12 13:30:57 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Install copr-selinux
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package:
|
2023-02-15 10:19:29 +01:00
|
|
|
state: latest
|
|
|
|
name: copr-selinux
|
2021-12-06 11:18:34 +01:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Start node exporter
|
2024-11-27 21:22:02 +01:00
|
|
|
service: state=started enabled=yes name=node_exporter
|
|
|
|
when:
|
|
|
|
- "'pulp' not in inventory_hostname"
|
2022-11-23 12:17:34 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Check offloading
|
2024-12-19 16:42:30 +10:00
|
|
|
# ansible.builtin.shell: "ethtool -k ens5 | egrep -q 'tcp-segmentation-offload: on|generic-receive-offload: on|generic-segmentation-offload: on'"
|
2024-11-29 20:22:42 +01:00
|
|
|
# register: offloading
|
|
|
|
# failed_when: offloading.rc == 2
|
|
|
|
# changed_when: "1 != 1"
|
|
|
|
# check_mode: no
|
|
|
|
#
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Disable offloading
|
2024-12-19 11:22:24 +10:00
|
|
|
# ansible.builtin.command: ethtool -K ens5 tso off gro off gso off
|
2024-11-29 20:22:42 +01:00
|
|
|
# when:
|
|
|
|
# - offloading.rc == 0
|
|
|
|
# - ansible_distribution == 'Fedora'
|
|
|
|
#
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Disable offloading (persitently)
|
2024-12-19 16:42:30 +10:00
|
|
|
# ansible.builtin.shell: "nmcli con modify '{{ aws_ipv6_con }}' ethtool.feature-tso off ethtool.feature-gro off ethtool.feature-gso off"
|
2024-11-29 20:22:42 +01:00
|
|
|
# when:
|
|
|
|
# - offloading.rc == 0
|
|
|
|
# - ansible_distribution == 'Fedora'
|
|
|
|
# tags:
|
|
|
|
# - config
|
|
|
|
#
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Check we have the needed ipv6
|
2024-12-19 16:42:30 +10:00
|
|
|
# ansible.builtin.shell: "nmcli con show '{{ aws_ipv6_con }}' | grep ipv6.addresses | grep {{ aws_ipv6_addr }}"
|
2024-11-29 20:22:42 +01:00
|
|
|
# register: ipv6_config_check
|
|
|
|
# failed_when: false
|
|
|
|
# changed_when: ipv6_config_check.rc == 1
|
|
|
|
# when:
|
|
|
|
# - aws_ipv6_addr is defined
|
|
|
|
# tags: ipv6_config
|
|
|
|
#
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Setup ipv6 networking
|
2024-12-19 16:42:30 +10:00
|
|
|
# ansible.builtin.shell: |
|
2024-11-29 20:22:42 +01:00
|
|
|
# nmcli con modify '{{ aws_ipv6_con }}' ipv6.method auto ipv6.may-fail yes ipv6.never-default no ipv6.addresses '{{ aws_ipv6_addr }}'
|
|
|
|
# nmcli con up '{{ aws_ipv6_con }}'
|
|
|
|
# when:
|
|
|
|
# - aws_ipv6_addr is defined
|
|
|
|
# - ipv6_config_check.changed
|
|
|
|
# tags: ipv6_config
|
2021-11-30 13:28:59 +01:00
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
- name: Install nrpe checks
|
2025-01-13 12:24:19 +10:00
|
|
|
ansible.builtin.template: src=copr_nrpe.cfg
|
2022-01-21 12:42:18 +01:00
|
|
|
dest=/etc/nrpe.d/copr_nrpe.cfg
|
|
|
|
notify:
|
2025-01-24 14:01:45 -08:00
|
|
|
- Restart nrpe
|
2022-01-21 12:42:18 +01:00
|
|
|
tags:
|
|
|
|
- nagios_client
|
|
|
|
- copr_cdn
|
|
|
|
- copr_ping
|
|
|
|
|
2025-01-14 20:18:57 +10:00
|
|
|
# - name: Enable and run logrotate service
|
2019-09-04 17:59:41 +02:00
|
|
|
# service: name="logrotate" state=started
|
2024-11-30 23:57:50 +01:00
|
|
|
|
|
|
|
# https://github.com/fedora-copr/copr/issues/3439
|
|
|
|
- name: Install iptables-nft
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package: name=iptables-nft state=present
|
2024-11-30 23:57:50 +01:00
|
|
|
register: iptables
|
|
|
|
|
|
|
|
- name: Remove iptables-legacy
|
2024-12-19 13:22:42 +10:00
|
|
|
ansible.builtin.package: name=iptables-legacy state=absent
|
2024-11-30 23:57:50 +01:00
|
|
|
|
|
|
|
- name: Restart iptables
|
|
|
|
service: name=iptables state=restarted
|
|
|
|
when: iptables.changed
|