diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index bf6f3b4..0c2558c 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,125 +1,126 @@ --- - include: uninstall.yml -# Repository for httpd +# Repository for httpd and php - 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 +# 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 - 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 diff --git a/roles/common/tasks/uninstall.yml b/roles/common/tasks/uninstall.yml index 4b36fcc..afc7b36 100644 --- a/roles/common/tasks/uninstall.yml +++ b/roles/common/tasks/uninstall.yml @@ -1,19 +1,18 @@ --- - name: remove old packages yum: name="{{ item }}" state=present with_items: - - rh-php72-runtime - php56u - php56u-mysql - php56u-gd - php56u-posix - php56u-pear - php56u-devel - php56u-ldap - php56u-mbstring - php56u-opcache - php56u-pecl-apcu - httpd ignore_errors: yes diff --git a/roles/phabricator/tasks/php.yml b/roles/phabricator/tasks/php.yml index b8559aa..3e1b85e 100644 --- a/roles/phabricator/tasks/php.yml +++ b/roles/phabricator/tasks/php.yml @@ -1,54 +1,73 @@ --- +- name: Install RH Software Collections + yum: + name="{{ item }}" + state=present + with_items: + - centos-release-scl + - name: Install PHP yum: name="{{ item }}" state=present with_items: - - php73-process - - php73-json - - php73-cli - - php73-pecl-apcu - - php73-gd - - php73-ldap - - php73-mbstring - - php73-opcache - - php73-mysqlnd - - php73-xml - - php73-devel + - 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-process + - rh-php72-php-cli - name: Copy php.ini configuration - template: src={{ php_ini }} dest=/etc/php.ini + template: src={{ php_ini }} dest=/etc/opt/rh/rh-php72/php.ini notify: reload apache -# FIXME -#- name: Install APC -# shell: yes '' | pecl install apc; echo '' -# args: -# creates: /usr/lib64/php/modules/apc.so +- 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 + +- name: Enable php path for all process + lineinfile: + dest: /etc/environment + line: 'PATH=/opt/rh/rh-php72/root/usr/bin:/opt/rh/rh-php72/root/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin' + state: present # 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 #