ansible/roles/copr/base/tasks/main.yml

122 lines
3.2 KiB
YAML
Raw Normal View History

---
# tasklist for setting up copr
# This is the base set of files needed for copr
# again to late to do it here
# - import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml"
# already included into the `base` role
#- import_tasks: "{{ tasks_path }}/postfix_basic.yml"
# To late to do it here (
#- name: setup correct hostname for copr machine
# hostname: name="{{ copr_hostbase }}.cloud.fedoraproject.org"
# # hostname: name="{{ hostbase|regex_replace('.*-$', '')}}.cloud.fedoraproject.org"
# tags:
# - config
- name: enable epel for non-fedora hosts
package: state=present pkg="epel-release"
when: ansible_distribution != 'Fedora'
- name: copy .forward file
copy: src="{{ _forward_src }}" dest="/root/.forward" owner=root group=root
tags:
- config
- name: deploy /etc/hosts file
2015-04-01 13:47:11 +00:00
copy: src="hosts" dest=/etc/ owner=root group=root mode=644
tags:
- config
2019-08-04 20:57:28 +02:00
- name: configure crond
copy: src=sysconfig.crond dest=/etc/sysconfig/crond
notify: restart crond
- name: install anacrontab
package: name=cronie-anacron state=present
- name: configure anacrond to not send mails to root user
lineinfile: dest=/etc/anacrontab
backup=yes
state=present
line='MAILTO=praiskup@fedoraproject.org'
regexp="^MAILTO"
notify: restart crond
2019-08-04 20:57:28 +02:00
2019-02-12 13:30:57 +01:00
- name: install copr-selinux
dnf: state=latest pkg=copr-selinux
2019-04-02 10:27:12 +02:00
tags:
- packages
2019-02-12 13:30:57 +01:00
- name: install node_exporter
dnf: state=present pkg=golang-github-prometheus-node-exporter
tags:
- packages
- name: restart node exporter
service: state=started enabled=yes name=node_exporter
- name: install dev helper packages
2019-04-02 10:27:12 +02:00
dnf:
state: present
pkg:
2022-11-22 23:29:56 +01:00
- acl # useful for ansible acl module
2019-04-02 10:27:12 +02:00
- "bash-completion"
- "screen"
- "tmux"
tags:
- packages
- name: install ethtool
2016-02-11 09:03:11 +01:00
dnf: state=present pkg=ethtool
tags:
- packages
- name: check offloading
2016-06-25 20:42:39 +00:00
shell: "ethtool -k eth0 | egrep -q 'tcp-segmentation-offload: on|generic-receive-offload: on|generic-segmentation-offload: on'"
register: offloading
2016-06-25 20:44:52 +00:00
failed_when: offloading.rc == 2
changed_when: "1 != 1"
check_mode: no
- name: disable offloading
command: ethtool -K eth0 tso off gro off gso off
2016-06-25 20:47:09 +00:00
when: offloading.rc == 0
- name: disable offloading (persitently)
shell: "nmcli con modify 'cloud-init eth0' ethtool.feature-tso off ethtool.feature-gro off ethtool.feature-gso off"
when: offloading.rc == 0
tags:
- config
- name: check we have the needed ipv6
shell: "nmcli con show 'cloud-init eth0' | grep ipv6.addresses | grep {{ aws_ipv6_addr }}"
register: ipv6_config_check
failed_when: false
changed_when: ipv6_config_check.rc == 1
when: aws_ipv6_addr is defined
tags: ipv6_config
- name: setup ipv6 networking
shell: |
2022-11-28 18:24:57 +01:00
nmcli con modify 'cloud-init eth0' ipv6.method auto ipv6.may-fail yes ipv6.never-default no ipv6.addresses '{{ aws_ipv6_addr }}'
nmcli con up 'cloud-init eth0'
when:
- aws_ipv6_addr is defined
- ipv6_config_check.changed
tags: ipv6_config
- name: install nrpe checks
template: src=copr_nrpe.cfg
dest=/etc/nrpe.d/copr_nrpe.cfg
notify:
- restart nrpe
tags:
- nagios_client
- copr_cdn
- copr_ping
# - name: enable and run logrotate service
# service: name="logrotate" state=started