Skip to content

Commit

Permalink
Ignore empty or missing Ansible inventory groups
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed May 8, 2020
1 parent fe1a3e5 commit deaf8f7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@ General
.. __: https://reuse.software/spec/
.. __: https://spdx.org/ids

- In new DebOps environments, Ansible will ignore any missing inventory groups
using the ``host_pattern_mismatch`` parameter. This will disable the "Could
not match supplied host pattern" warning message present in most of the
playbooks included in DebOps. To disable this message in an existing
environment, add in the :file:`.debops.cfg` configuration file:

.. code-block:: ini
[ansible inventory]
host_pattern_mismatch = ignore
:ref:`debops.cran` role
'''''''''''''''''''''''

Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ check-links:
.PHONY: test-playbook-syntax
test-playbook-syntax:
@printf "%s\n" "Testing Ansible playbook syntax..."
@ANSIBLE_ROLES_PATH="ansible/roles" ansible-playbook --syntax-check \
ansible/playbooks/bootstrap.yml \
ansible/playbooks/site.yml
@ANSIBLE_ROLES_PATH="ansible/roles" ANSIBLE_HOST_PATTERN_MISMATCH=ignore \
ansible-playbook --syntax-check ansible/playbooks/bootstrap.yml \
ansible/playbooks/bootstrap-ldap.yml \
ansible/playbooks/site.yml

.PHONY: test-ansible-lint
test-ansible-lint:
Expand Down
3 changes: 3 additions & 0 deletions bin/debops-init
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ stdout_callback = yaml
;callback_plugins = /my/plugins/callback
;roles_path = /my/roles
[ansible inventory]
host_pattern_mismatch = ignore
[ansible paramiko]
;record_host_keys=True
Expand Down
1 change: 1 addition & 0 deletions lib/tests/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ allow_world_readable_tmpfiles = true
pipelining = False
stdout_callback = yaml
bin_ansible_callbacks = true
host_pattern_mismatch = ignore

0 comments on commit deaf8f7

Please sign in to comment.