dev/provisioning/playbook.yml
changeset 2 00e2916104fe
parent 1 01a844d292ac
child 4 f55970e41793
equal deleted inserted replaced
1:01a844d292ac 2:00e2916104fe
    14 #   - name: install language pack
    14 #   - name: install language pack
    15 #     command: localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
    15 #     command: localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
    16 
    16 
    17     - name: set hostname
    17     - name: set hostname
    18       hostname: name={{site_name}}
    18       hostname: name={{site_name}}
       
    19     - name: set hosts IPv4
       
    20       lineinfile:
       
    21         dest: /etc/hosts
       
    22         line: 127.0.0.1   corpus-parole corpus-parole.local
       
    23     - name: set hosts IPv6
       
    24       lineinfile:
       
    25         dest: /etc/hosts
       
    26         line: ::1         corpus-parole corpus-parole.local
    19 
    27 
    20     - name: ensure correct locale LC_ALL
    28     - name: ensure correct locale LC_ALL
    21       lineinfile: dest=/etc/sysconfig/i18n regexp=^LC_ALL= line=LC_ALL="en_US.UTF-8"
    29       lineinfile: dest=/etc/sysconfig/i18n regexp=^LC_ALL= line=LC_ALL="en_US.UTF-8"
    22     - name: ensure correct locale LANG
    30     - name: ensure correct locale LANG
    23       lineinfile: dest=/etc/sysconfig/i18n regexp=^LANG= line=LANG="en_US.UTF-8"
    31       lineinfile: dest=/etc/sysconfig/i18n regexp=^LANG= line=LANG="en_US.UTF-8"
    93         - nginx
   101         - nginx
    94         - postgresql94-server
   102         - postgresql94-server
    95         - python-psycopg2
   103         - python-psycopg2
    96         - htop
   104         - htop
    97         - openssl
   105         - openssl
    98         - php
   106         - php56
    99         - php-cli
   107         - php56-php-fpm
   100         - php-fpm
   108         - php56-php-mbstring
   101         - php-mbstring
   109         - php56-php-mcrypt
   102         - php-mcrypt
   110         - php56-php-gd
   103         - php-curl
   111         - php56-php-pgsql
   104         - php-gd
       
   105         - php-json
       
   106         - php-pgsql
       
   107         - php-xml
       
   108         - java-1.8.0-openjdk
   112         - java-1.8.0-openjdk
   109         - tomcat6
   113         - tomcat6
   110 
   114 
   111 #TODO: check php-fpm config in /etc/php5/fpm/...
       
   112 
       
   113 #    - name: Start the services
       
   114 #      service: name={{item}} state=started enabled=true
       
   115 #      with_items:
       
   116 #        - postgres
       
   117 #        - nginx
       
   118 #        - tomcat
       
   119 
   115 
   120 ## php-fpm config
   116 ## php-fpm config
   121 
   117 
   122 # set fpm user to nginx
   118 # set fpm user to nginx
   123 # authoroze /var/log/php-fpm
   119 # authorize /var/log/php-fpm
   124     - name: copy sysconfig for php-fpm
   120     - name: copy sysconfig for php-fpm
   125       copy: src=files/sysconfig_php-fpm dest=/etc/sysconfig/php-fpm
   121       copy: src=files/sysconfig_php-fpm dest=/opt/remi/php56/root/etc/sysconfig/php-fpm
   126     - name: set /var/log/php-fpm permission
   122     - name: set /opt/remi/php56/root/var/log/php-fpm permission
   127       file: path=/var/log/php-fpm/ state=directory owner=nginx group=nginx
   123       file: path=/opt/remi/php56/root/var/log/php-fpm/ state=directory owner=nginx group=nginx
   128 
   124 
   129     - name: set php-fpm listen to socket
   125     - name: set php-fpm listen to socket
   130       lineinfile:
   126       lineinfile:
   131         dest: /etc/php-fpm.d/www.conf
   127         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   132         regexp: '^listen\s*='
   128         regexp: '^listen\s*='
   133         line: 'listen = /var/run/php-fpm/php-fpm.sock'
   129         line: 'listen = /opt/remi/php56/root/var/run/php-fpm/php-fpm.sock'
   134         state: present
   130         state: present
   135 
   131 
   136     - name: set php-fpm user
   132     - name: set php-fpm user
   137       lineinfile:
   133       lineinfile:
   138         dest: /etc/php-fpm.d/www.conf
   134         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   139         regexp: '^user\s*='
   135         regexp: '^user\s*='
   140         line: 'user = nginx'
   136         line: 'user = nginx'
   141         state: present
   137         state: present
   142 
   138 
   143     - name: set php-fpm group
   139     - name: set php-fpm group
   144       lineinfile:
   140       lineinfile:
   145         dest: /etc/php-fpm.d/www.conf
   141         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   146         regexp: '^group\s*='
   142         regexp: '^group\s*='
   147         line: 'group = nginx'
   143         line: 'group = nginx'
   148         state: present
   144         state: present
   149 
   145 
   150     - name: set php-fpm user
   146     - name: set php-fpm user
   151       lineinfile:
   147       lineinfile:
   152         dest: /etc/php-fpm.d/www.conf
   148         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   153         regexp: '^;listen.owner\s*='
   149         regexp: '^;listen.owner\s*='
   154         line: 'listen.owner = nginx'
   150         line: 'listen.owner = nginx'
   155         state: present
   151         state: present
   156 
   152 
   157     - name: set php-fpm group
   153     - name: set php-fpm group
   158       lineinfile:
   154       lineinfile:
   159         dest: /etc/php-fpm.d/www.conf
   155         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   160         regexp: '^;listen.group\s*='
   156         regexp: '^;listen.group\s*='
   161         line: 'listen.group = nginx'
   157         line: 'listen.group = nginx'
   162         state: present
   158         state: present
   163 
   159 
   164     - name: set php-fpm permission
   160     - name: set php-fpm permission
   165       lineinfile:
   161       lineinfile:
   166         dest: /etc/php-fpm.d/www.conf
   162         dest: /opt/remi/php56/root/etc/php-fpm.d/www.conf
   167         regexp: '^;listen.mode\s*='
   163         regexp: '^;listen.mode\s*='
   168         line: 'listen.mode = 0660'
   164         line: 'listen.mode = 0660'
   169         state: present
   165         state: present
   170 
   166 
       
   167     - name: add link to php56 fpm log
       
   168       file: path=/var/log/php56-php-fpm src=/opt/remi/php56/root/var/log/php-fpm state=link
   171 
   169 
   172     - name: restart php-fpm
   170     - name: restart php-fpm
   173       service: name=php-fpm state=restarted enabled=yes
   171       service: name=php56-php-fpm state=restarted enabled=yes
   174 
   172 
   175 
   173 
   176 ## nginx config
   174 ## nginx config
   177 
   175 
   178     - name: create ssl folder
   176     - name: create ssl folder
   291     #install composer
   289     #install composer
   292     - stat: path=/usr/local/bin/composer
   290     - stat: path=/usr/local/bin/composer
   293       register: composer_bin
   291       register: composer_bin
   294 
   292 
   295     - name: install composer
   293     - name: install composer
   296       shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin
   294       shell: curl -sS https://getcomposer.org/installer | scl enable php56 'php -- --install-dir=/usr/local/bin'
   297       when: composer_bin.stat.exists == False
   295       when: composer_bin.stat.exists == False
   298     - name: rename composer
   296     - name: link composer
   299       command: mv /usr/local/bin/composer.phar /usr/local/bin/composer
   297       file: path=/usr/local/bin/composer src=/usr/local/bin/composer.phar state=link
   300       when: composer_bin.stat.exists == False
   298       when: composer_bin.stat.exists == False
   301 
   299 
   302     #install node
   300     #install node
   303     - stat: path=/usr/bin/node
   301     - stat: path=/usr/bin/node
   304       register: node_bin
   302       register: node_bin