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

AnsibleUndefinedVariable error #3

Open
ridvankaratas opened this issue Sep 5, 2018 · 4 comments
Open

AnsibleUndefinedVariable error #3

ridvankaratas opened this issue Sep 5, 2018 · 4 comments

Comments

@ridvankaratas
Copy link

Hi,

I'm getting this error fatal: [games.mikandi.com]: FAILED! => { "changed": false, "msg": "AnsibleUndefinedVariable: 'list object' has no attribute 'items'" }

while it's on ansible-role-prometheus : set prometheus config yml

even if I put -vvvv it doesn't give that much details about the error. my ansible version is 2.5.0

Any advice?

@shellegtk
Copy link

shellegtk commented Sep 5, 2018 via email

@ridvankaratas
Copy link
Author

ridvankaratas commented Sep 6, 2018

Hi,

Here you go:

TASK [prometheus : set prometheus config yml] ********************************************************************************
task path: /Users/ridvan/Desktop/Projects/ansible-mikandi-config/roles/prometheus/tasks/config-prometheus.yml:81
<games.mikandi.com> ESTABLISH SSH CONNECTION FOR USER: root
<games.mikandi.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/ridvan/Desktop/Projects/ansible-mikandi-config/keys/games_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/ridvan/.ansible/cp/%h-%r games.mikandi.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<games.mikandi.com> (0, '/root\n', 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 11281\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<games.mikandi.com> ESTABLISH SSH CONNECTION FOR USER: root
<games.mikandi.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/ridvan/Desktop/Projects/ansible-mikandi-config/keys/games_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/ridvan/.ansible/cp/%h-%r games.mikandi.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "echo /root/.ansible/tmp/ansible-tmp-1536232463.4-179002939826161" && echo ansible-tmp-1536232463.4-179002939826161="echo /root/.ansible/tmp/ansible-tmp-1536232463.4-179002939826161" ) && sleep 0'"'"''
<games.mikandi.com> (0, 'ansible-tmp-1536232463.4-179002939826161=/root/.ansible/tmp/ansible-tmp-1536232463.4-179002939826161\n', 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 11281\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<games.mikandi.com> ESTABLISH SSH CONNECTION FOR USER: root
<games.mikandi.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/ridvan/Desktop/Projects/ansible-mikandi-config/keys/games_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/ridvan/.ansible/cp/%h-%r games.mikandi.com '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tmp-1536232463.4-179002939826161/ > /dev/null 2>&1 && sleep 0'"'"''
<games.mikandi.com> (0, '', 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 11281\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
fatal: [games.mikandi.com]: FAILED! => {
"changed": false,
"msg": "AnsibleUndefinedVariable: 'list object' has no attribute 'items'"
}
to retry, use: --limit @/Users/ridvan/Desktop/Projects/ansible-mikandi-config/prometheus.retry

PLAY RECAP *******************************************************************************************************************
games.mikandi.com : ok=26 changed=0 unreachable=0 failed=1

@shellegtk
Copy link

shellegtk commented Sep 6, 2018 via email

@ridvankaratas
Copy link
Author

ridvankaratas commented Sep 6, 2018

Hi,

I exactly copied prometheus.yml.j2 file under templates folder. Do I need to add anything else?

Here is how my playbook look like:


  • hosts: games
    become: true
    roles:
    • role: prometheus

I've changed the role name as "prometheus"

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

2 participants