Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 3132: run ansible-pull from the right dir, with HOME set
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
localhost | ||
localhost ansible_python_interpreter=/usr/local/bin/python2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/sh | ||
|
||
# set some environment variables that ansible-pull needs | ||
export HOME=/home/{{ service_account }} | ||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/{{ service_account }}/bin | ||
|
||
# run ansible-pull from the directory containing the repository (and, thus, the inventory file) | ||
cd /home/{{ service_account}}/repo | ||
ansible-pull \ | ||
-C master \ | ||
-d /home/{{ service_account }}/repo/ \ | ||
-m git \ | ||
-U {{ ansible_git_repository }} \ | ||
-o \ | ||
-s 3600 \ | ||
-i localhost \ | ||
--vault-password-file=/home/{{ service_account }}/.vault-password \ | ||
local.yml |