I have a follow up question to the thread in here: How do I pass username and password while using Ansible Git module?
I am trying to achieve a similar task where I am passing a username and password to GitHub through Ansible. Here is what I am using for my playbook:
- name: ANSIBLE - Shop Installation
hosts: host_list
vars_prompt:
- name: "githubuser"
prompt: "Enter your github username"
private: no
- name: "githubpassword"
prompt: "Enter your github password"
private: yes
- hosts: host_list
tasks:
- name: Get the latest version through Git
git:
repo: 'https://{{ githubuser }}:{{ githubpassword }}@github.com/foo/bar.git'
dest: /tmp
After running through this, I get the following error message:
fatal: []: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'githubuser' is undefined\n\nThe error appears to have been in 'playbook.yml'
Any ideas where I may have gone wrong here?
I am running Ansible 2.7.1