diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 30bdfb9..bf6f3b4 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,125 +1,125 @@ --- - include: uninstall.yml # Repository for httpd - name: Software Collections repository yum: name=centos-release-scl state=present # IUS Community Project for PHP and GIT - yum: name: https://centos7.iuscommunity.org/ius-release.rpm state: present ## Proxy for TEST - name: HTTP Proxy lineinfile: dest: /etc/rc.local line: "{{ item }}" with_items: - "export http_proxy={{ http_proxy }}" - "export https_proxy={{ http_proxy }}" - "export rsync_proxy={{ http_proxy }}" - "export ftp_proxy={{ http_proxy }}" when: env == "test" and http_proxy is defined ## Root and centos passwords - user: name=root password="{{ user_pwd_root }}" - user: name=centos password="{{ user_pwd_centos }}" ## Selinux - name: Disable SELinux selinux: policy=targeted state=disabled - name: Permanently disable SELinux copy: src=selinux-config dest=/etc/selinux/config # EPEL - name: Install EPEL repo. yum: name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" state: present - name: Import EPEL GPG key. rpm_key: key: "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7" state: present # Basic packages - yum: name=git state=absent - yum: name="{{ item }}" state=present update_cache=yes with_items: - htop - - git2u + - git222 - screen - vim - ntp - yum-cron - iftop - tcpdump - iperf - iotop - yum-plugin-versionlock - name: SSH Keys authorized_key: user=root key="{{ item }}" with_items: "{{ ssh_keys }}" - name: SSH Keys authorized_key: user=centos key="{{ item }}" with_items: "{{ ssh_keys }}" - name: Enable NTP service: name: ntpd enabled: true state: started - name: NTP for test servers lineinfile: dest: /etc/ntp.conf line: 'server 10.91.0.2 prefer' insertbefore: 'server 0\.centos\.pool\.ntp\.org iburst' when: env == "test" # Hosts - name: Hosts file template: src: hosts dest: /etc/hosts - name: Hosts file for lbs lineinfile: dest: /etc/hosts line: "{{ internal_ip }} c4science-jump00" - name: Hosts file for 10.0.0.217 lineinfile: dest: /etc/hosts line: "10.0.0.217 c4science-monit-cluster" # Scripts - name: Create scripts directory file: state="directory" path="/root/scripts" - name: Process memory copy: src=ps_mem.py dest=/root/scripts/ps_mem.py mode=0750 - name: Process swap copy: src=swap.sh dest=/root/scripts/swap.sh mode=0750 # Security - name: Security updates via yum-cron copy: src=yum-cron.conf dest=/etc/yum/yum-cron.conf # Monit - include: monit.yml