Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify hosts file? #18

Open
mabushey opened this issue Jun 7, 2018 · 2 comments
Open

How to specify hosts file? #18

mabushey opened this issue Jun 7, 2018 · 2 comments

Comments

@mabushey
Copy link

mabushey commented Jun 7, 2018

  • module.ansible_provisioner.null_resource.provisioner: Error running command 'ansible-playbook --user=ubuntu -e host=54.219.165.55 interview_devops_playbook.yml': exit status 4. Output: [WARNING]: provided hosts list is empty, only localhost is available. Note
    that the implicit localhost does not match 'all'

there is no inventory file being passed.... :(
How can I specify the hosts file? I would like -i ./hosts added to the command string. Terraform is awesome, but when the code is in a module it gets cached and becomes difficult to modify.

@mabushey
Copy link
Author

mabushey commented Jun 7, 2018

I guess it's dynamic and does not write to an inventory file. The raw install python is not idempotent so I figured it just wasn't working.

  • In the raw command, the changed does not work. Use this:
register: output
changed_when: output.stdout != ""
  • Inventory is spelled wrong: Create a runtime inventorty with an ip address of a host
  • Github is now owned by a patent troll, consider migrating to a service like Gitlab.

@mabushey
Copy link
Author

mabushey commented Jun 7, 2018

You should also create a group_vars/all file so people can specify the correct pem to use:

$ cat group_vars/all                                                                                                                                                                                                                             
ansible_ssh_private_key_file: ~/.ssh/my_key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant