diff --git a/tests/test.yml b/tests/test.yml index 9c620a2..2369a55 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -2,20 +2,30 @@ - hosts: all pre_tasks: - - apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present - - apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present + - name: APT_REPOSITORY | Install backports + apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present + - name: APT | Install needed packages + apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present with_items: - php5-fpm - curl - fcgiwrap - - service: name=fcgiwrap state=started + - name: SERVICE | Force start fcgiwrap + service: name=fcgiwrap state=started register: sf - - pause: seconds=5 + - name: PAUSE | Prevent bugs (CGI not fully loaded) + pause: seconds=5 when: sf.changed - - file: path=/etc/ansible-ssl state=directory - - copy: src=file/test.crt dest=/etc/ansible-ssl/test.crt - - copy: src=file/test.key dest=/etc/ansible-ssl/test.key + - name: FILE | Create an internal SSL dir + file: path={{ int_ansible_ssl_dir }} state=directory + - name: COPY | Deploy test certificate + copy: src=file/test.crt dest={{ int_ansible_ssl_dir }}/test.crt + - name: COPY | Deploy test key + copy: src=file/test.key dest={{ int_ansible_ssl_dir }}/test.key vars: +# Internal vars + int_ansible_ssl_dir: '/etc/ansible-ssl' +# Role vars nginx_backports: true nginx_php: true nginx_upstreams: @@ -45,8 +55,8 @@ state: 'absent' nginx_ssl_pairs: - name: 'test-ssl-predeployed.local' - dest_key: /etc/ansible-ssl/test.key - dest_cert: /etc/ansible-ssl/test.crt + dest_key: "{{ int_ansible_ssl_dir }}/test.key" + dest_cert: "{{ int_ansible_ssl_dir }}/test.crt" - name: 'test-ssl.local' key: | -----BEGIN RSA PRIVATE KEY----- @@ -162,17 +172,30 @@ roles: - ../../ post_tasks: - - apt: pkg={{ item }} state=present +# -------------------------------- +# Apps +# -------------------------------- + - name: APT | Install web apps + apt: pkg={{ item }} state=present with_items: - nagios3 - backuppc - - service: name=backuppc state=started + - name: SERVICE | Ensure backuppc is started + service: name=backuppc state=started + +# -------------------------------- +# Deploy index files +# -------------------------------- - name: -- Add PHP file -- copy: dest="{{ nginx_root }}/{{ item }}/public/index.php" content="