(ansible)[ansible@ansible-server code]$ grep -R pbis_require_membership_of group_vars/
group_vars/all/all.yaml:pbis_require_membership_of: '"DOMAIN\\teaminfra" "DOMAIN\\LinuxAdmins"'
(ansible)[ansible@ansible-server code]$ grep -R pbis_require_membership_of roles/linux-pbis/vars/hostname
pbis_require_membership_of: '"DOMAIN\\teaminfra" "DOMAIN\\LinuxAdmins" "DOMAIN\\StorageAdmins"'
TASK [linux-pbis : debug pbis_require_membership_of] ******************************************************************************************************************************************************************************
task path: roles/linux-pbis/tasks/main.yaml:62
ok: [hostname] => {
"pbis_require_membership_of": "VARIABLE IS NOT DEFINED!"
}
...
TASK [linux-pbis : copy temp config file] ******************************************************************************************************************************************************************************
task path: roles/linux-pbis/tasks/reconfig_pbis.yaml:1
fatal: [hostname]: FAILED! => {"failed": true, "msg": "The conditional check 'require_membership_of.stdout != pbis_require_membership_of' failed. The error was: error while evaluating conditional (require_membership_of.stdout != pbis_require_membership_of): 'pbis_require_membership_of' is undefined\n\nThe error appears to have been in 'roles/linux-pbis/tasks/reconfig_pbis.yaml': line 1, 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: copy temp config file\n ^ here\n"}
to retry, use: --limit @playbooks/linux/linux_pbis.retry
---
sendmail_mail_relay: mail-relay.domain.local
pbis_require_membership_of: '"DOMAIN\\teaminfra" "DOMAIN\\LVLinuxAdmins"'
My hunch is that you directory structure is not correct so Ansible can't
find the files.
In the same directory as you inventory file, output of these commands
would help track it down.
tree -L 3
$ tree -L 3
.
├── ansible.cfg
├── cache
... <REDACTED>
│ ├── server1
│ └── server2
├── examples
│ └── group_vars
│ ├── all
│ └── win
├── filter_plugins
├── group_vars
│ ├── all
│ │ └── all.yaml
│ ├── all.yaml
│ ├── all.yml
│ ├── linux
│ │ └── linux.yaml
│ ├── vagrant_linux.yaml
│ ├── vagrant_win.yaml
│ ├── win
│ │ ├── secure.yaml
│ │ └── win.yaml
│ └── workstations
│ ├── secure.yaml
│ └── workstations.yaml
├── host_vars
│ ├── hostname.yaml
│ └── vagrant2.yaml
├── inventory
│ ├── centos_templates
│ ├── production
│ │ ├── generated
│ │ └── production
│ ├── test
│ ├── vagrant
│ └── workstations
├── library
├── playbooks
│ ├── linux
│ │ ├── linux_ansible_control_machine.yaml
│ │ ├── linux_ftp.yaml
│ │ ├── linux_jump.yaml
│ │ ├── linux_nameservers.yaml
│ │ ├── linux_os_hardening.yaml
│ │ ├── linux_pbis.retry
│ │ ├── linux_pbis.yaml
│ │ ├── linux.retry
│ │ ├── linux_set_root_password.yaml
│ │ ├── linux_utility.yaml
│ │ ├── linux_webservers.yaml
│ │ ├── linux.yaml
│ │ └── templates
│ ├── testing
│ │ ├── dumpall.j2
│ │ ├── dump_vars.yaml
│ │ └── vagrant.yaml
│ ├── win
│ │ └── win_servers.yaml
│ └── workstations
│ └── win_workstations.yaml
├── README.md
├── roles
│ ├── linux-ansible-user
│ │ ├── defaults
│ │ ├── files
│ │ ├── handlers
│ │ ├── meta
│ │ ├── tasks
│ │ ├── templates
│ │ └── vars
│ ├── linux-common
│ │ ├── defaults
│ │ ├── files
│ │ ├── handlers
│ │ ├── tasks
│ │ ├── templates
│ │ └── vars
│ ├── linux-pbis
│ │ ├── defaults
│ │ ├── files
│ │ ├── meta
│ │ ├── tasks
│ │ ├── templates
│ │ └── vars
│ ├── linux-sendmail-client
│ │ ├── defaults
│ │ ├── files
│ │ ├── handlers
│ │ ├── meta
│ │ ├── tasks
│ │ ├── templates
│ │ └── vars
│ ├── linux-set-root-password
│ │ └── tasks
│ ├── linux-sudoers
│ │ ├── defaults
│ │ ├── files
│ │ ├── handlers
│ │ ├── meta
│ │ ├── tasks
│ │ ├── templates
│ │ └── vars
├── scripts
│ ├── ad_kerberos
│ ├── Gemfile
│ ├── Gemfile.lock
│ └── windows-servers.rb
├── site.retry
├── site.yaml
└── Vagrantfile
ansible --version
$ ansible --version
ansible 2.3.0 (devel 92a568c816) last updated 2017/01/20 13:14:32 (GMT -600)
config file =
configured module search path = Default w/o overrides
But also your original message you wrote this
"I've recently updated from Ansible 2.1 to the latest (using git pull),
which
may or may not have been when this issue started."
It you didn't remove 2.1 completely before you install from source you
may have a combination of the two, and that will give you some strange
behaviors.
On 20. jan. 2017 21:32, Elliott Barrere wrote:
>
So this did work at some point?
If so did it stop after you upgraded, if thats the case does it work if
you downgrade to the last working version?
>> In the same directory as you inventory file, output of these commands
>> would help track it down.
>> tree -L 3
>>
> $ tree -L 3
> .
>
> ├── ansible.cfg
> ├── group_vars
> ├── host_vars
> ├── inventory
> ├── site.yaml
I think I see what could be a problem.
I guess you are running ansible-playbook from the directory ansible.cfg
is in, and running someting like this?
ansible-playbook -i inventory/<sonething> playbooks/linux/linux.yaml
The reason I ask is that host_vars and group_vars must be in the same
directory as the inventory or playbooks[1]
And here they are on the top level, so only site.yml is able to use
host_vars and group_vars in your layout.
If you move the playbook you have problem with to the same level as
site.yml, does it work?
> $ ansible --version
>
> ansible 2.3.0 (devel 92a568c816) last updated 2017/01/20 13:14:32 (GMT -600)
> config file =
> configured module search path = Default w/o overrides
Did you run this the the ansible directory, it should have displayed the
path to ansible.cfg in "config file", but yours is empty.