diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 0980331..0017a8a 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,119 +1,126 @@ --- - include: uninstall.yml +# Repository for httpd and php +- name: Software Collections repository + yum: + name=centos-release-scl + 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 # IUS Community Project for PHP and GIT - yum: name: https://centos7.iuscommunity.org/ius-release.rpm state: present # Basic packages - yum: name=git state=absent - yum: name="{{ item }}" state=present update_cache=yes with_items: - htop - git2u - 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 diff --git a/roles/phabricator/tasks/php.yml b/roles/phabricator/tasks/php.yml index e9dc0d5..14213a7 100644 --- a/roles/phabricator/tasks/php.yml +++ b/roles/phabricator/tasks/php.yml @@ -1,64 +1,59 @@ --- -- name: Software Collections repository - yum: - name=centos-release-scl - state=present - - name: Install PHP yum: name="{{ item }}" state=present with_items: - pcre-devel - rh-php72 - rh-php72-php - rh-php72-php-devel - rh-php72-php-gd - rh-php72-php-pear - rh-php72-php-ldap - rh-php72-php-mbstring - rh-php72-php-opcache - rh-php72-php-pecl-apcu - rh-php72-php-mysqlnd #- rh-php72-php-posix - name: Copy php.ini configuration template: src={{ php_ini }} dest=/etc/opt/rh/rh-php72/php.ini notify: reload apache - name: Install APC shell: yes '' | pecl install apc; echo '' args: creates: /usr/lib64/php/modules/apc.so - name: Enable Software Collection for php template: src: "{{ php_enable }}" dest: /etc/profile.d/php.sh # Mailparse #- name: Symlink for phpize # file: # path: /usr/bin/phpize5 # src: /usr/bin/phpize # state: link # #- name: Symlink for php-config # file: # path: /usr/bin/php-config5 # src: /usr/bin/php-config # state: link # #- name: Install mailparse php module # shell: pecl install -n mailparse-2.1.6 # args: # creates: /usr/lib64/php/modules/mailparse.so # #- name: Load mailparse # lineinfile: # dest: /etc/php.d/30-mailparse.ini # line: 'extension=mailparse.so' # create: yes # state: present #