Add snakeoil certs

This commit is contained in:
Patrick Neff 2022-07-08 21:52:50 +02:00
parent fc3ddc9dd9
commit 947dc4460d
2 changed files with 18 additions and 1 deletions

View File

@ -1,4 +1,5 @@
galaxy_info: galaxy_info:
role_name: nginx role_name: nginx
dependencies: [] dependencies:
- ssl-snakeoil

View File

@ -1,4 +1,5 @@
- name: Install packages. - name: Install packages.
become: true
tags: nginx tags: nginx
ansible.builtin.package: ansible.builtin.package:
state: present state: present
@ -7,11 +8,19 @@
register: nginx_installed register: nginx_installed
- name: Backup default nginx config - name: Backup default nginx config
become: true
command: mv /etc/nginx /etc/nginx.orig command: mv /etc/nginx /etc/nginx.orig
when: nginx_installed.changed == true when: nginx_installed.changed == true
register: nginx_original_config_backup register: nginx_original_config_backup
- name: Add ssl-cert group to www-data
become: true
command: usermod -a -G ssl-cert www-data
when: nginx_installed.changed == true
register: nginx_group_added
- name: Clone h5bp nginx config. - name: Clone h5bp nginx config.
become: true
tags: nginx tags: nginx
ansible.builtin.git: ansible.builtin.git:
repo: https://github.com/h5bp/server-configs-nginx repo: https://github.com/h5bp/server-configs-nginx
@ -21,10 +30,17 @@
when: nginx_original_config_backup.changed == true when: nginx_original_config_backup.changed == true
- name: Copy default fastcgi_params back to h5bp nginx config. - name: Copy default fastcgi_params back to h5bp nginx config.
become: true
command: cp /etc/nginx.orig/fastcgi_params /etc/nginx command: cp /etc/nginx.orig/fastcgi_params /etc/nginx
when: nginx_original_config_backup.changed == true when: nginx_original_config_backup.changed == true
- name: Copy default snakeoil.conf back to h5bp nginx config.
become: true
command: cp /etc/nginx.orig/snippets/snakeoil.conf /etc/nginx
when: nginx_original_config_backup.changed == true
- name: Remove default nginx directory. - name: Remove default nginx directory.
become: true
tags: nginx tags: nginx
ansible.builtin.file: ansible.builtin.file:
path: /etc/nginx.orig path: /etc/nginx.orig