Browse Source

fix service tasks name

services
Andrea Cimbalo 8 years ago
parent
commit
8cf49d4956
16 changed files with 62 additions and 48 deletions
  1. +2
    -2
      handlers/service.yaml
  2. +0
    -2
      roles/apache/defaults/main.yml
  3. +0
    -16
      roles/apache/tasks/main.yaml
  4. +1
    -0
      roles/dokuwiki/meta/main.yaml
  5. +1
    -1
      roles/dokuwiki/tasks/main.yaml
  6. +1
    -12
      roles/dokuwiki/templates/docuwiki_nginx.j2
  7. +36
    -0
      roles/dokuwiki/templates/docuwiki_nginx.j2.TODO
  8. +0
    -1
      roles/lxc_guest/tasks/main.yaml
  9. +1
    -0
      roles/nginx/defaults/main.yml
  10. +2
    -1
      roles/nginx/handlers/main.yaml
  11. +11
    -0
      roles/nginx/tasks/main.yaml
  12. +1
    -1
      roles/roundcube/tasks/main.yaml
  13. +2
    -3
      roles/roundcube/templates/roundcube_nginx.j2
  14. +0
    -5
      roles/sympa/tasks/main.yaml
  15. +3
    -3
      tasks/service.yaml
  16. +1
    -1
      wiki.yaml

+ 2
- 2
handlers/service.yaml View File

@ -1,5 +1,5 @@
---
- name: restart "{{ service_name }}"
- name: restart {{ service_name }}
service: name="{{ service_name }}" state=restarted
- name: reload "{{ service_name }}"
- name: reload {{ service_name }}
service: name="{{ service_name }}" state=reloaded

+ 0
- 2
roles/apache/defaults/main.yml View File

@ -1,2 +0,0 @@
---
php: false

+ 0
- 16
roles/apache/tasks/main.yaml View File

@ -1,16 +0,0 @@
---
- include: service.yaml
vars:
service_name: apache2
service_packages:
- apache2
- name: validate apache2 configuration
command: nginx -t -c /etc/nginx/nginx.conf
changed_when: False
- name: enable apache configuration
file:
src: "/etc/apache2/sites-available/{{ config_name }}"
dest: "/etc/apache2/sites-enabled/{{ config_name }}"
state: link
notify: restart apache2

+ 1
- 0
roles/dokuwiki/meta/main.yaml View File

@ -1,3 +1,4 @@
---
dependencies:
- role: nginx
php: true

+ 1
- 1
roles/dokuwiki/tasks/main.yaml View File

@ -5,7 +5,7 @@
- dokuwiki
- name: add nginx config for docukiwi
template:
src: docukiwi_nginx.j2
src: docuwiki_nginx.j2
dest: "/etc/nginx/sites-available/{{ config_name }}"
notify:
- enable nginx configuration


+ 1
- 12
roles/dokuwiki/templates/docuwiki_nginx.j2 View File

@ -1,24 +1,13 @@
server {
listen 80;
listen [::]:80;
server_name wiki.domain.example;
return 301 https://$server_name$request_uri;
}
server {
listen [::]:443 ssl;
listen 443 ssl;
server_name wiki.domain.example;
client_max_body_size 4M;
client_body_buffer_size 128k;
root /dokuwiki;
root /usr/share/dokuwiki;
index doku.php;
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
location / { try_files $uri $uri/ @dokuwiki; }
location @dokuwiki {


+ 36
- 0
roles/dokuwiki/templates/docuwiki_nginx.j2.TODO View File

@ -0,0 +1,36 @@
server {
listen 80;
listen [::]:80;
server_name wiki.domain.example;
return 301 https://$server_name$request_uri;
}
server {
listen [::]:443 ssl;
listen 443 ssl;
client_max_body_size 4M;
client_body_buffer_size 128k;
root /usr/share/dokuwiki;
index doku.php;
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
location / { try_files $uri $uri/ @dokuwiki; }
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
}
location ~ \.php$ {
try_files $uri $uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}

+ 0
- 1
roles/lxc_guest/tasks/main.yaml View File

@ -91,7 +91,6 @@
- name: set pub key
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- bash -c "echo '{{ cert_key.result }}' > /etc/ssh/ssh_host_ed25519_key-cert.pub"
register: set_pub_key
notify: restart-container
when: "cert_key_existance.rc != 0"
- name: update container network configuration


+ 1
- 0
roles/nginx/defaults/main.yml View File

@ -1,2 +1,3 @@
---
is_proxy: false
php: false

+ 2
- 1
roles/nginx/handlers/main.yaml View File

@ -1,5 +1,6 @@
---
- include: service.yaml
# static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
vars:
service_name: nginx
@ -12,4 +13,4 @@
src: "/etc/nginx/sites-available/{{ config_name }}"
dest: "/etc/nginx/sites-enabled/{{ config_name }}"
state: link
notify: restart nginx
# notify: restart nginx

+ 11
- 0
roles/nginx/tasks/main.yaml View File

@ -1,12 +1,23 @@
---
- include: service.yaml
# static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
vars:
service_name: nginx
service_packages:
- nginx
- name: disable nginx default configuration
file: path=/etc/nginx/sites-enabled/default state=absent
notify: restart nginx
- name: install php5-fpm
apt: name={{ item }} state=latest
with_items:
- php5-fpm
when: php | bool
notify:
- restart nginx
- name: upload nginx proxy configuration
template:
src: proxy_nginx.j2


+ 1
- 1
roles/roundcube/tasks/main.yaml View File

@ -1,5 +1,5 @@
- name: add jessie-backports repository
- apt_repository: repo='deb http://ftp.debian.org/debian jessie-backports main' state=present
apt_repository: repo='deb http://ftp.debian.org/debian jessie-backports main' state=present
- name: install roundcube packages
apt:


roles/roundcube/templates/roundcube-config.j2 → roles/roundcube/templates/roundcube_nginx.j2 View File


+ 0
- 5
roles/sympa/tasks/main.yaml View File

@ -1,9 +1,4 @@
---
- include: service.yaml
vars:
service_name: nginx
service_packages:
- nginx
- name: install sympa and associated packages
apt: name={{ item }} state=latest
with_items:


+ 3
- 3
tasks/service.yaml View File

@ -1,6 +1,6 @@
---
- name: install "{{ service_name }}"
- name: install {{ service_name }}
apt: name="{{ item }}" state=present
with_items: "{{ service_packages }}"
- name: start "{{ service_name }}" at boot
service: name="{{ service_name }}" state=started enabled=yes
- name: start {{ service_name }} at boot
service: name="{{ service_name }}" enabled=yes

wiki_server.yaml → wiki.yaml View File


Loading…
Cancel
Save