Closed bassplay3r closed 2 years ago
I just tested your vars.yaml from the main
branch on commit 2340e5ec5ec298d855cc8125fc4e407590510928
All seems fine. I did invoke some errors via the hostnames to make sure the chars is working; it worked as expected.
[root@bastion ocp4-helpernode]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
[root@bastion ocp4-helpernode]# ansible-playbook --version
ansible-playbook 2.9.27
config file = /root/ocp4-helpernode/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Sep 9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
x
[root@bastion ocp4-helpernode]# ansible-playbook -e @test.yaml tasks/main.yml
PLAY [all] ***********************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Validate values for DNS compatibility] *************************************************************************************************************************************************************************************************
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: item is search('{{ chars }}')
skipping: [localhost] => (item=barnacle.netapp.com)
skipping: [localhost] => (item=helper)
skipping: [localhost] => (item=bootstrap)
skipping: [localhost] => (item={'name': 'master0', 'ipaddr': '192.168.1.21', 'macaddr': '52:54:00:ae:42:8d'})
skipping: [localhost] => (item={'name': 'master1', 'ipaddr': '192.168.1.22', 'macaddr': '52:54:00:cd:5f:e1'})
skipping: [localhost] => (item={'name': 'master2', 'ipaddr': '192.168.1.23', 'macaddr': '52:54:00:77:7e:ac'})
skipping: [localhost] => (item={'name': 'worker0', 'ipaddr': '192.168.1.11', 'macaddr': '52:54:00:5a:18:fa'})
skipping: [localhost] => (item={'name': 'worker1', 'ipaddr': '192.168.1.12', 'macaddr': '52:54:00:ec:60:5d'})
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
I'll downgrade Ansible and test that.
Did you install ansible via pip or a rpm based package manager. I'm currently using what the DVD ISO had.
Installed via RPM. I downgraded to match your Ansible version and replicated the issue. Any chance you can update to Ansible 2.9 latest?
[root@bastion ocp4-helpernode]# ansible-playbook --version
ansible-playbook 2.8.18
config file = /root/ocp4-helpernode/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Sep 9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
[root@bastion ocp4-helpernode]# ansible-playbook -e @test.yaml tasks/main.yml
PLAY [all] ***********************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Validate values for DNS compatibility] *************************************************************************************************************************************************************************************************
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: item is search('{{ chars }}')
skipping: [localhost] => (item=barnacle.netapp.com)
skipping: [localhost] => (item=helper)
skipping: [localhost] => (item=bootstrap)
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'item is search('{{ chars }}')' failed. The error was: Unexpected templating type error occurred on ({% if item is search('(\\\\_|\\\\$|\\\\\\|\\\\/|\\\\=|\\\\)|\\\\(|\\\\&|\\\\^|\\\\%|\\\\$|\\\\#|\\\\@|\\\\!|\\\\*)') %} True {% else %} False {% endif %}): expected string or bytes-like object\n\nThe error appears to be in '/root/ocp4-helpernode/tasks/validate_host_names.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: Validate values for DNS compatibility\n ^ here\n"}
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
I'm not sure I can. I'm behind a proxied environment for the RHEL8 repos. Is there a specific repo I can tell my IT folks to mirror that will allow me to get v2.9?
it's ansible-2.9-for-rhel-8-x86_64-rpms
Thank you @salanisor for pointing this out. But just to clarify, this is called out in the prereqs
However, it might be nice for someone (read: not me because I have no cycles) to do a version check of ansible when you first run the playbook. That would save a lot of folks some headache
FYI we use your stuff in our CI so I would never see it in the docs. Dying early would be helpful. Thanks
Upgrade to ansible-2.9 works for me with a warning TASK [Validate values for DNS compatibility] *** [WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: item is search('{{ chars }}') skipping: [localhost] => (item=barnacle.netapp.com) skipping: [localhost] => (item=helper) skipping: [localhost] => (item=bootstrap) skipping: [localhost] => (item={'name': 'master0', 'ipaddr': '192.168.1.21', 'macaddr': '52:54:00:ae:42:8d'}) skipping: [localhost] => (item={'name': 'master1', 'ipaddr': '192.168.1.22', 'macaddr': '52:54:00:cd:5f:e1'}) skipping: [localhost] => (item={'name': 'master2', 'ipaddr': '192.168.1.23', 'macaddr': '52:54:00:77:7e:ac'}) skipping: [localhost] => (item={'name': 'worker0', 'ipaddr': '192.168.1.11', 'macaddr': '52:54:00:5a:18:fa'}) skipping: [localhost] => (item={'name': 'worker1', 'ipaddr': '192.168.1.12', 'macaddr': '52:54:00:ec:60:5d'})
The ansible version check is now in devel
#275 ...I'll probably cut a release to main
in the coming days as there's been a lot of fixes.
There's probably a better way of checking for RFC 952, and RFC 1123 compliance, but I'll leave that for another time.
I just moved my helper RHEL 8.5 and the ocp4-helpernode playbook is failing with the following, what am I missing?