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

asnsible variables not found #63

Closed
mrafieee opened this Issue Dec 18, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@mrafieee

mrafieee commented Dec 18, 2017

Running ansible 2.4.1.0

ansible-playbook elk.yml -i inventory/local -b -v

TASK [elasticsearch : Copy templated elasticsearch.yml] ****************************************************************************************************************************************************
fatal: [node5]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'ansible_default_ipv4' is undefined"}
...ignoring

TASK [elasticsearch : Check if system memory is greater than 64G] ******************************************************************************************************************************************
fatal: [node5]: FAILED! => {"msg": "The conditional check 'ansible_memory_mb.real.total|int >= 65536' failed. The error was: error while evaluating conditional (ansible_memory_mb.real.total|int >= 65536): 'ansible_memory_mb' is undefined\n\nThe error appears to have been in '/vagrant/ansible-host/roles/elasticsearch/tasks/main.yml': line 38, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Check if system memory is greater than 64G\"\n  ^ here\n"}
@KnechtionsCoding

This comment has been minimized.

Show comment
Hide comment
@KnechtionsCoding

KnechtionsCoding Dec 18, 2017

Contributor

Did it gather facts prior? Both of those variables are Ansible specific variables. What is the complete output of the error?

Contributor

KnechtionsCoding commented Dec 18, 2017

Did it gather facts prior? Both of those variables are Ansible specific variables. What is the complete output of the error?

@mrafieee

This comment has been minimized.

Show comment
Hide comment
@mrafieee

mrafieee Dec 18, 2017

``Facts gathered and passed
...
gather_facts: yes
vars_files:
- group_vars/all.yml
roles:
...

mrafieee commented Dec 18, 2017

``Facts gathered and passed
...
gather_facts: yes
vars_files:
- group_vars/all.yml
roles:
...

@KnechtionsCoding

This comment has been minimized.

Show comment
Hide comment
@KnechtionsCoding

KnechtionsCoding Dec 18, 2017

Contributor

What's your inventory like? If you are trying to run it against local host you probably have to delegate to local host or it gets confused.

Contributor

KnechtionsCoding commented Dec 18, 2017

What's your inventory like? If you are trying to run it against local host you probably have to delegate to local host or it gets confused.

@mrafieee

This comment has been minimized.

Show comment
Hide comment
@mrafieee

mrafieee Dec 18, 2017

## different ip than the default iface

node5 ansible_ssh_host=node5 ansible_ssh_user=vagrant ip=192.168.3.15
node6 ansible_ssh_host=node6 ansible_ssh_user=vagrant ip=192.168.3.16
node7 ansible_ssh_host=node7 ansible_ssh_user=vagrant ip=192.168.3.17
node8 ansible_ssh_host=node8 ansible_ssh_user=vagrant ip=192.168.3.18

localhost

[streaming]
node6
node7
node8

[management]
node5

[elk]
node5

[elk-client]
node6
node7
node8

mrafieee commented Dec 18, 2017

## different ip than the default iface

node5 ansible_ssh_host=node5 ansible_ssh_user=vagrant ip=192.168.3.15
node6 ansible_ssh_host=node6 ansible_ssh_user=vagrant ip=192.168.3.16
node7 ansible_ssh_host=node7 ansible_ssh_user=vagrant ip=192.168.3.17
node8 ansible_ssh_host=node8 ansible_ssh_user=vagrant ip=192.168.3.18

localhost

[streaming]
node6
node7
node8

[management]
node5

[elk]
node5

[elk-client]
node6
node7
node8
@KnechtionsCoding

This comment has been minimized.

Show comment
Hide comment
@KnechtionsCoding

KnechtionsCoding Dec 18, 2017

Contributor

Are you running these against Containers? Or VMs? Is IPRoute installed? I found this issue with containers, but a minimal installation might have the same issue. The resolution there was for iproute to be installed.

Contributor

KnechtionsCoding commented Dec 18, 2017

Are you running these against Containers? Or VMs? Is IPRoute installed? I found this issue with containers, but a minimal installation might have the same issue. The resolution there was for iproute to be installed.

@mrafieee

This comment has been minimized.

Show comment
Hide comment
@mrafieee

mrafieee Dec 18, 2017

it was against vms, my issue resolved by gathering facts.

mrafieee commented Dec 18, 2017

it was against vms, my issue resolved by gathering facts.

@sadsfae sadsfae closed this Dec 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment