Minor fixes to get ansible to work on localhost
This commit is contained in:
parent
11264cf712
commit
9031b4fff0
3 changed files with 4 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
- hosts: local
|
- hosts: localhost
|
||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
|
|
|
@ -22,14 +22,14 @@ function _ansible () {
|
||||||
echo "Bootstrapping Ansible"
|
echo "Bootstrapping Ansible"
|
||||||
if [[ $playbook ]];
|
if [[ $playbook ]];
|
||||||
then
|
then
|
||||||
if [ ! -f inventory ];
|
if [ ! -f inventory.yml ];
|
||||||
then
|
then
|
||||||
echo "Inventory file not found"
|
echo "Inventory file not found"
|
||||||
touch inventory
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Sit down, relax and kick your legs up, fun is about to begin..."
|
echo "Sit down, relax and kick your legs up, fun is about to begin..."
|
||||||
ansible-playbook -i inventory Ansible/$playbook --ask-sudo-pass
|
ansible-playbook -i inventory.yml -c local Ansible/$playbook --ask-sudo-pass
|
||||||
else
|
else
|
||||||
echo "Choose a profile to run from the list below:"
|
echo "Choose a profile to run from the list below:"
|
||||||
find Ansible/ -maxdepth 1 -name "*.yml" -type f -printf " - %f\n"
|
find Ansible/ -maxdepth 1 -name "*.yml" -type f -printf " - %f\n"
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
ansible
|
ansible
|
||||||
python-dnf
|
|
||||||
|
|
Loading…
Reference in a new issue