Commit f6f64d43 by Jocelyn Delalande

rename "sudo*" → "become*"

Ansible 2.0 style
parent 0a7ddf3c
......@@ -20,7 +20,7 @@
user: name={{ lettravox_user }} home={{ lettravox_home_dir }}
- name: fetch application sources
sudo: yes
become: yes
git:
repo: '{{ lettravox_git_repo_url }}'
dest: '{{ lettravox_install_dir }}'
......@@ -37,24 +37,24 @@
recurse: yes
- name: create virtualenv
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
shell: virtualenv {{ lettravox_venv_dir }} creates={{ lettravox_venv_dir }}
- name: install pip requirements
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
pip:
requirements: '{{ lettravox_install_dir }}/requirements.txt'
virtualenv: '{{ lettravox_venv_dir }}'
- name: install gunicorn
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
pip: name=gunicorn virtualenv={{ lettravox_venv_dir }}
- name: set local_settings.py
sudo_user: '{{ lettravox_user }}'
become_user: '{{ lettravox_user }}'
template:
src: local_settings.j2
dest: "{{ lettravox_install_dir }}/local_settings.py"
......@@ -62,8 +62,8 @@
notify: restart lettravox
- name: migrate db
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
shell: ./manage.py migrate --noinput
args:
chdir: '{{ lettravox_install_dir }}'
......@@ -72,8 +72,8 @@
DJANGO_SETTINGS_FILE: '{{ lettravox_install_dir }}/settings.py'
- name: wipe old captcha app dir
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
file:
path: '{{ lettravox_install_dir }}/captcha'
state: absent
......@@ -88,8 +88,8 @@
recurse: yes
- name: collect static files
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
shell: './manage.py collectstatic --noinput'
args:
chdir: '{{ lettravox_install_dir }}'
......@@ -97,8 +97,8 @@
PATH: "{{ lettravox_venv_bin_path }}:{{ ansible_env.PATH }}"
- name: give read rights on static files to the httpd
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
command: "setfacl -R -m u:{{ lettravox_httpd_user }}:rx {{ item }}"
with_items:
......@@ -106,8 +106,8 @@
- "{{ lettravox_static_dir }}"
- name: give read rights on static files to the httpd (default rule)
sudo: yes
sudo_user: '{{ lettravox_user }}'
become: yes
become_user: '{{ lettravox_user }}'
command: "setfacl -R -m d:u:{{ lettravox_httpd_user }}:rx {{ item }}"
with_items:
......
......@@ -37,7 +37,7 @@
- name: Find rsync server remote key
command: ssh-keyscan "{{ item.remote_host }}"
register: rsync_server_host_key
sudo_user: "{{ item.local_user }}"
become_user: "{{ item.local_user }}"
with_items: rsync_mirror_mirrors
- name: Adds server host key if not already present
......
......@@ -13,7 +13,7 @@
user: name={{ transparency_user }} home={{ transparency_home_dir }}
- name: fetch application sources
sudo: yes
become: yes
git:
repo: '{{ transparency_git_repo_url }}'
dest: '{{ transparency_install_dir }}'
......@@ -30,24 +30,24 @@
recurse: yes
- name: create virtualenv
sudo: yes
sudo_user: '{{ transparency_user }}'
become: yes
become_user: '{{ transparency_user }}'
shell: virtualenv {{ transparency_venv_dir }} --python=/usr/bin/python3 creates={{ transparency_venv_dir }}
- name: install pip requirements
sudo: yes
sudo_user: '{{ transparency_user }}'
become: yes
become_user: '{{ transparency_user }}'
pip:
requirements: '{{ transparency_install_dir }}/requirements.txt'
virtualenv: '{{ transparency_venv_dir }}'
- name: install gunicorn
sudo: yes
sudo_user: '{{ transparency_user }}'
become: yes
become_user: '{{ transparency_user }}'
pip: name=gunicorn virtualenv={{ transparency_venv_dir }}
- name: set local_settings.py
sudo_user: '{{ transparency_user }}'
become_user: '{{ transparency_user }}'
template:
src: local_settings.j2
dest: "{{ transparency_install_dir }}/transparency/local_settings.py"
......@@ -55,8 +55,8 @@
notify: restart transparency
- name: migrate db
sudo: yes
sudo_user: '{{ transparency_user }}'
become: yes
become_user: '{{ transparency_user }}'
shell: ./manage.py migrate --noinput
args:
chdir: '{{ transparency_install_dir }}'
......@@ -73,8 +73,8 @@
recurse: yes
- name: collect static files
sudo: yes
sudo_user: '{{ transparency_user }}'
become: yes
become_user: '{{ transparency_user }}'
shell: './manage.py collectstatic --noinput'
args:
chdir: '{{ transparency_install_dir }}'
......
......@@ -12,4 +12,4 @@ ALLOWED_HOSTS = ['{{ transparency_domain }}']
# Where static files gets collected
STATIC_ROOT = '{{ transparency_static_dir }}'
ORGANIZATION_NAME = '{{ transparency_organization_name }}'
\ No newline at end of file
ORGANIZATION_NAME = '{{ transparency_organization_name }}'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment