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

One or more undefined variables: 'ansible_os_family' is undefined #5148

Closed
jlaska opened this issue Dec 3, 2013 · 3 comments
Closed

One or more undefined variables: 'ansible_os_family' is undefined #5148

jlaska opened this issue Dec 3, 2013 · 3 comments
Labels
bug This issue/PR relates to a bug.

Comments

@jlaska
Copy link
Contributor

jlaska commented Dec 3, 2013

Using ansible-1.4.1 ...

# ansible --version
ansible 1.4.1

... the play completes successfully

# ansible-playbook -i /path/to/inventory --check -u root --ask-pass --ask-sudo-pass -l '~host-1[3-7]+\.example\.com' trunk/language_features/roletest.yml
SSH password: 
sudo password [defaults to SSH password]: 

PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [host-16.example.com]
ok: [host-15.example.com]
ok: [host-13.example.com]
ok: [host-17.example.com]
ok: [host-14.example.com]

TASK: [shell echo "hi this is a pre_task step about {{inventory_hostname}}"] *** 
skipping: [host-16.example.com]
skipping: [host-17.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

TASK: [foo | copy operation] ************************************************** 
ok: [host-16.example.com]
ok: [host-15.example.com]
ok: [host-17.example.com]
ok: [host-13.example.com]
ok: [host-14.example.com]

TASK: [foo | template operation] ********************************************** 
ok: [host-15.example.com]
ok: [host-16.example.com]
ok: [host-17.example.com]
ok: [host-13.example.com]
ok: [host-14.example.com]

TASK: [foo | demo that parameterized roles work] ****************************** 
skipping: [host-16.example.com]
skipping: [host-17.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

TASK: [foo | copy operation] ************************************************** 
ok: [host-16.example.com]
ok: [host-17.example.com]
ok: [host-15.example.com]
ok: [host-14.example.com]
ok: [host-13.example.com]

TASK: [foo | template operation] ********************************************** 
ok: [host-16.example.com]
ok: [host-17.example.com]
ok: [host-15.example.com]
ok: [host-13.example.com]
ok: [host-14.example.com]

TASK: [foo | demo that parameterized roles work] ****************************** 
skipping: [host-17.example.com]
skipping: [host-16.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

TASK: [shell echo 'this is a loose task'] ************************************* 
skipping: [host-16.example.com]
skipping: [host-17.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

TASK: [shell echo 'this is a post_task about {{inventory_hostname}}'] ********* 
skipping: [host-16.example.com]
skipping: [host-17.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

PLAY RECAP ******************************************************************** 
host-13.example.com        : ok=5    changed=0    unreachable=0    failed=0   
host-14.example.com        : ok=5    changed=0    unreachable=0    failed=0   
host-15.example.com        : ok=5    changed=0    unreachable=0    failed=0   
host-16.example.com        : ok=5    changed=0    unreachable=0    failed=0   
host-17.example.com        : ok=5    changed=0    unreachable=0    failed=0   

When upgrading to the latest ansible-1.5 development stream ...

# ansible --version
ansible 1.5

The same play fails ...

# ansible-playbook -i /path/to/inventory --check -u root --ask-pass --ask-sudo-pass -l '~host-1[3-7]+\.example\.com' trunk/language_features/roletest.yml
SSH password: 
sudo password [defaults to SSH password]: 

PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [host-16.example.com]
ok: [host-17.example.com]
ok: [host-15.example.com]
ok: [host-13.example.com]
ok: [host-14.example.com]

TASK: [shell echo "hi this is a pre_task step about {{inventory_hostname}}"] *** 
skipping: [host-16.example.com]
skipping: [host-17.example.com]
skipping: [host-15.example.com]
skipping: [host-13.example.com]
skipping: [host-14.example.com]

TASK: [foo | copy operation] ************************************************** 
ok: [host-16.example.com]
ok: [host-15.example.com]
ok: [host-17.example.com]
ok: [host-14.example.com]
ok: [host-13.example.com]

TASK: [foo | template operation] ********************************************** 
fatal: [host-16.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-15.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-14.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-17.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-13.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-16.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-15.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-14.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-17.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}
fatal: [host-13.example.com] => {'msg': "One or more undefined variables: 'ansible_os_family' is undefined", 'failed': True}

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/var/lib/awx/roletest.retry

host-13.example.com        : ok=2    changed=0    unreachable=1    failed=0   
host-14.example.com        : ok=2    changed=0    unreachable=1    failed=0   
host-15.example.com        : ok=2    changed=0    unreachable=1    failed=0   
host-16.example.com        : ok=2    changed=0    unreachable=1    failed=0   
host-17.example.com        : ok=2    changed=0    unreachable=1    failed=0   
@sivel
Copy link
Member

sivel commented Dec 3, 2013

To clarify from what I found by testing, this only happens when using the --check argument. Without --check things work as expected.

jctanner added a commit that referenced this issue Dec 3, 2013
Fix new new module_style determination. Fixes #5148
@jlaska
Copy link
Contributor Author

jlaska commented Dec 3, 2013

Retested with the latest from git ... the reported problem has been resolved. Thanks!

@paul-english
Copy link

I'm still running into this issue with 1.5.3. Though it's sporadic and sometimes succeeds.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants