diff --git a/playbooks/groups/download.yml b/playbooks/groups/download.yml new file mode 100644 index 0000000000..226079e1e9 --- /dev/null +++ b/playbooks/groups/download.yml @@ -0,0 +1,50 @@ +- name: Download servers + hosts: download + user: root + gather_facts: False + accelerate: True + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "{{ private }}/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + tasks: + - include: "{{ tasks }}/accelerate_prep.yml" + + handlers: + - include: "{{ handlers }}/restart_services.yml" + +- name: make the box be real + hosts: download + user: root + gather_facts: True + accelerate: True + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "{{ private }}/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + roles: + - base + - rkhunter + - denyhosts + - nagios_client + - fas_client + - collectd/base + - download + - mod_limitipconn + - rsyncd + + tasks: + - include: "{{ tasks }}/hosts.yml" + - include: "{{ tasks }}/yumrepos.yml" + - include: "{{ tasks }}/2fa_client.yml" + - include: "{{ tasks }}/motd.yml" + - include: "{{ tasks }}/sudo.yml" + when: env != "staging" + - include: "{{ tasks }}/apache.yml" + + handlers: + - include: "{{ handlers }}/restart_services.yml" diff --git a/roles/download/files/logrotate-rsync-fedora b/roles/download/files/logrotate-rsync-fedora new file mode 100644 index 0000000000..2932e5a76a --- /dev/null +++ b/roles/download/files/logrotate-rsync-fedora @@ -0,0 +1,6 @@ +/var/log/rsyncd-fedora.log { + monthly + rotate 4 + notifempty + missingok +} diff --git a/roles/download/files/motd_fedora b/roles/download/files/motd_fedora new file mode 100644 index 0000000000..d5e01127b8 --- /dev/null +++ b/roles/download/files/motd_fedora @@ -0,0 +1,10 @@ +---------------------------- +Fedora Master Mirror Servers +---------------------------- +Modules for Fedora Core and Extras have been removed, as this content is +no longer updated. See the instructions below for how to mirror current +content. + +See http://fedoraproject.org/wiki/Infrastructure/Mirroring for +instructions. +---------------------------- diff --git a/roles/download/files/system_identification b/roles/download/files/system_identification new file mode 100644 index 0000000000..6165d4b4fe --- /dev/null +++ b/roles/download/files/system_identification @@ -0,0 +1,9 @@ +Security Category: Moderate +Primary Contact: Fedora Admins - admin@fedoraproject.org +Purpose: Provides mirror access to downstream servers. +Environment: Production +Relationship: Mirrormanager depends on this host for some crawling. This host + only depends on the netapp - vtap-fedora-nfs01.storage.phx2.redhat.com + +This document is provided as part of CSI standards. +See http://infrastructure.fedoraproject.org/csi/security-policy/ for more information diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml new file mode 100644 index 0000000000..8a7f67efae --- /dev/null +++ b/roles/download/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- name: Get nfs-utils + yum: pkg=nfs-utils state=installed + +- name: Create /srv/pub directory + file: path=/srv/pub state=directory + +- name: Set httpd_use_nfs seboolean + action: seboolean name=httpd_use_nfs + +- name: /srv/pub file contexts + command: semanage fcontext -a -t httpd_sys_content_t "/srv/pub(/.*)?" + +- name: /var/log/rsyncd-fedora.log file context + command: semanage fcontext -a -t rsync_log_t "/var/log/rsyncd-fedora.log" + +- name: /etc/system_identification + copy: src=system_identification dest=/etc/system_identification + +- name: /etc/motd_fedora + copy: src=motd_fedora dest=/etc/motd_fedora + +- name: Configure logrotate for /var/log/rsyncd-fedora.log + copy: src=logrotate-rsync-fedora dest=/etc/logrotate.d/rsync-fedora + +- name: NFS mount points (phx2) + mount: name=/srv/pub src=vtap-fedora-nfs01.storage.phx2.redhat.com:/vol/fedora_ftp/fedora.redhat.com/pub fstype=nfs opts=defaults,fsc,ro,noatime,nodev,nosuid,hard,intr,nfsvers=3,nocto,actimeo=600 state=mounted + when: datacenter == 'phx2' + +- name: NFS mount points (rdu) + mount: name=/srv/pub src=172.31.1.10:/vol/fedora_ftp/fedora.redhat.com/pub fstype=nfs opts=defaults,ro,noatime,nodev,nosuid,hard,intr,nfsvers=3 state=mounted + when: datacenter == 'phx2' diff --git a/roles/mod_limitipconn/files/limitipconn.conf b/roles/mod_limitipconn/files/limitipconn.conf new file mode 100644 index 0000000000..f50cc9f6bf --- /dev/null +++ b/roles/mod_limitipconn/files/limitipconn.conf @@ -0,0 +1,17 @@ +# This module will not function unless mod_status is loaded and the +# "ExtendedStatus On" directive is set. So load only if mod_status is too. + + + # This is always needed + ExtendedStatus On + + # mod_limitipconn configuration + LoadModule limitipconn_module modules/mod_limitipconn.so + + # A global default configuration doesn't make much sense. See the README + # from the mod_limitipconn package for configuration examples. + + MaxConnPerIP 15 + OnlyIPLimit application/octet-stream application/x-rpm + + diff --git a/roles/mod_limitipconn/tasks/main.yml b/roles/mod_limitipconn/tasks/main.yml new file mode 100644 index 0000000000..06c95e0428 --- /dev/null +++ b/roles/mod_limitipconn/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Install package + yum: pkg=mod_limitipconn state=installed + +- name: Configuration file + copy: src=limitipconn.conf dest=/etc/httpd/conf.d/limitipconn.conf