From 68d312d936cb5843fe43a4c09f43bc940261d9d8 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Sun, 15 Jan 2017 17:47:36 -0800 Subject: [PATCH] Remove become: True the xenial docker image doesn't have sudo, so become doesn't work. It runs as root, so no need for it --- ch13/ansible/roles/mezzanine/handlers/main.yml | 2 -- ch13/ansible/roles/mezzanine/tasks/django.yml | 3 --- ch13/ansible/roles/mezzanine/tasks/main.yml | 1 - ch13/ansible/roles/mezzanine/tasks/nginx.yml | 4 ---- 4 files changed, 10 deletions(-) diff --git a/ch13/ansible/roles/mezzanine/handlers/main.yml b/ch13/ansible/roles/mezzanine/handlers/main.yml index 0913020..137b354 100644 --- a/ch13/ansible/roles/mezzanine/handlers/main.yml +++ b/ch13/ansible/roles/mezzanine/handlers/main.yml @@ -1,7 +1,5 @@ --- - name: restart supervisor supervisorctl: name=gunicorn_mezzanine state=restarted - become: True - name: restart nginx service: name=nginx state=restarted - become: True diff --git a/ch13/ansible/roles/mezzanine/tasks/django.yml b/ch13/ansible/roles/mezzanine/tasks/django.yml index 8a0c685..97bfa2b 100644 --- a/ch13/ansible/roles/mezzanine/tasks/django.yml +++ b/ch13/ansible/roles/mezzanine/tasks/django.yml @@ -8,7 +8,6 @@ - pip - virtualenv - virtualenvwrapper - become: True - name: install required python packages pip: name={{ item }} virtualenv={{ mezzanine_venv_path }} with_items: @@ -49,11 +48,9 @@ template: src=gunicorn.conf.py.j2 dest={{ mezzanine_proj_path }}/gunicorn.conf.py - name: set the supervisor config file template: src=supervisor.conf.j2 dest=/etc/supervisor/conf.d/mezzanine.conf - become: True notify: restart supervisor - name: ensure config path exists file: path={{ mezzanine_conf_path }} state=directory - become: True when: tls_enabled - name: install poll twitter cron job cron: > diff --git a/ch13/ansible/roles/mezzanine/tasks/main.yml b/ch13/ansible/roles/mezzanine/tasks/main.yml index 975a15e..5f697f7 100644 --- a/ch13/ansible/roles/mezzanine/tasks/main.yml +++ b/ch13/ansible/roles/mezzanine/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: install apt packages apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 - become: True with_items: - git - libjpeg-dev diff --git a/ch13/ansible/roles/mezzanine/tasks/nginx.yml b/ch13/ansible/roles/mezzanine/tasks/nginx.yml index 1852181..5331607 100644 --- a/ch13/ansible/roles/mezzanine/tasks/nginx.yml +++ b/ch13/ansible/roles/mezzanine/tasks/nginx.yml @@ -1,24 +1,20 @@ - name: set the nginx config file template: src=nginx.conf.j2 dest=/etc/nginx/sites-available/mezzanine.conf notify: restart nginx - become: True - name: enable the nginx config file file: src: /etc/nginx/sites-available/mezzanine.conf dest: /etc/nginx/sites-enabled/mezzanine.conf state: link notify: restart nginx - become: True - name: remove the default nginx config file file: path=/etc/nginx/sites-enabled/default state=absent notify: restart nginx - become: True - name: create ssl certificates command: > openssl req -new -x509 -nodes -out {{ mezzanine_proj_name }}.crt -keyout {{ mezzanine_proj_name }}.key -subj '/CN={{ domains[0] }}' -days 3650 chdir={{ mezzanine_conf_path }} creates={{ mezzanine_conf_path }}/{{ mezzanine_proj_name }}.crt - become: True when: tls_enabled notify: restart nginx -- 2.44.0