From: Lorin Hochstein Date: Mon, 16 Jan 2017 01:57:46 +0000 (-0800) Subject: Replace ansible_env.HOME with ansible_root_dir X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=099738713bea023bc6b976b4fca7d5fdaff3b9e5;p=ansiblebook.git Replace ansible_env.HOME with ansible_root_dir --- diff --git a/ch13/ansible/container.yml b/ch13/ansible/container.yml index 0275ccf..c398f65 100644 --- a/ch13/ansible/container.yml +++ b/ch13/ansible/container.yml @@ -9,6 +9,7 @@ defaults: twitter_access_token_secret: 1974cf8419114bdd9d4ea3db7a210d90 twitter_consumer_key: 1f1c627530b34bb58701ac81ac3fad51 twitter_consumer_secret: 36515c2b60ee4ffb9d33d972a7ec350a + mezzanine_root_dir: /srv mezzanine_proj_app: mezzanine_example mezzanine_proj_name: "{{ mezzanine_proj_app }}" locale: en_US.UTF-8 diff --git a/ch13/ansible/roles/mezzanine/tasks/django.yml b/ch13/ansible/roles/mezzanine/tasks/django.yml index 97bfa2b..7e8b1c1 100644 --- a/ch13/ansible/roles/mezzanine/tasks/django.yml +++ b/ch13/ansible/roles/mezzanine/tasks/django.yml @@ -1,5 +1,5 @@ - name: create a logs directory - file: path="{{ ansible_env.HOME }}/logs" state=directory + file: path="{{ mezzanine_root_dir }}/logs" state=directory - name: check out the repository on the host git: repo={{ mezzanine_repo_url }} dest={{ mezzanine_proj_path }} accept_hostkey=yes - name: install Python requirements globally via pip diff --git a/ch13/ansible/roles/mezzanine/vars/main.yml b/ch13/ansible/roles/mezzanine/vars/main.yml index 24c0bc6..5037c0f 100644 --- a/ch13/ansible/roles/mezzanine/vars/main.yml +++ b/ch13/ansible/roles/mezzanine/vars/main.yml @@ -1,10 +1,10 @@ --- # vars file for mezzanine mezzanine_user: "{{ ansible_user }}" -mezzanine_venv_home: "{{ ansible_env.HOME }}/.virtualenvs" +mezzanine_venv_home: "{{ mezzanine_root_dir }}/.virtualenvs" mezzanine_venv_path: "{{ mezzanine_venv_home }}/{{ mezzanine_proj_name }}" mezzanine_repo_url: git@github.com:ansiblebook/mezzanine_example.git -mezzanine_proj_path: "{{ ansible_env.HOME }}/mezzanine/{{ mezzanine_proj_name }}" +mezzanine_proj_path: "{{ mezzanine_root_dir }}/mezzanine/{{ mezzanine_proj_name }}" mezzanine_settings_path: "{{ mezzanine_proj_path }}/{{ mezzanine_proj_name }}" mezzanine_reqs_path: requirements.txt mezzanine_conf_path: /etc/nginx/conf