diff --git a/ansible/inventories/group_vars/automotive/automotive.yaml b/ansible/inventories/group_vars/automotive/automotive.yaml index 502f30a..ee349a1 100644 --- a/ansible/inventories/group_vars/automotive/automotive.yaml +++ b/ansible/inventories/group_vars/automotive/automotive.yaml @@ -12,10 +12,11 @@ db_root_password: "{{ automotive_mysql_root_password }}" nginx_docker_tag: 1.31.1 nginx_server_name: automotive.sse.cloud.isti.cnr.it -ssl: false +ssl: true wordpress_docker_tag: 7.0.0-php8.2-apache docker_base_volume_path: /usr/data/wp docker_wordpress_hostname: automotive_test +certbot_docker_tag: v5.6.0 diff --git a/ansible/playbooks/roles/docker-certbot/tasks/main.yaml b/ansible/playbooks/roles/docker-certbot/tasks/main.yaml new file mode 100644 index 0000000..9cfcef1 --- /dev/null +++ b/ansible/playbooks/roles/docker-certbot/tasks/main.yaml @@ -0,0 +1,18 @@ +--- +- name: Pull certbot image + docker_image: + name: "certbot/certbot:{{ certbot_docker_tag }}" + source: pull + +- name: Create container with certbot image + docker_container: + name: certbot + image: certbot/certbot + networks: + - name: "{{ docker_network_name }}" + hostname: certbot + volumes: + - "{{ docker_base_volume_path }}/certbot/logs:/var/log/letsencrypt" + - "{{ docker_base_volume_path }}/nginx/ssl:/etc/letsencrypt/live/{{ nginx_server_name}}" + + restart: true \ No newline at end of file diff --git a/ansible/playbooks/wordpress.yaml b/ansible/playbooks/wordpress.yaml index 8024f6b..dffff08 100644 --- a/ansible/playbooks/wordpress.yaml +++ b/ansible/playbooks/wordpress.yaml @@ -10,4 +10,5 @@ - chrissayon.wordpress_docker.network - chrissayon.wordpress_docker.mysql - chrissayon.wordpress_docker.wordpress + - docker-certbot - chrissayon.wordpress_docker.nginx