Ansible role for running puppet
Go to file
Ian Wienand e9fc2df1bc Clear out old facts
In debugging why I631e3e3592a9be5c7da642cf34eec6d9758bf161 was not
rolling out to the zuul executors, I eventually found
/etc/facter/facts.d/ansible.json was present on a number of hosts and
effectively pinning the project-config checkout to an old reference.

Given the dates around file creation and the pinned change number, it
seems very likely something happened during the openstack->opendev
transition where some hosts had ansible run with a specific
project_config_ref set as a fact.  Although the fact is now unset,
nothing will ever clear the old ansible.json which keeps applying.

We could remove all stale files by hand; but a) it's not clear where
it ran (although likely only hosts starting with z*) and b) we leave a
chance for it to happen again.

We could clear this after every puppet run; but it seems like this
role should leave the system largely in the state it ran puppet in.

Thus this clears out the file before the puppet run if no facts are
given.  This should fix our immediate issue on all hosts.

Change-Id: I96adf4fb77f06b18fe73b6f10d1b07b7fe44385f
2019-05-30 07:35:21 +10:00
defaults Allow overiding the remote hieradata link dest 2018-08-17 13:43:46 -05:00
handlers Add all of the files needed to make this a role 2015-02-22 22:59:39 -05:00
library Clear out old facts 2019-05-30 07:35:21 +10:00
meta Fix ansible-lint 2019-05-13 18:30:12 +02:00
tasks Fix ansible-lint 2019-05-13 18:30:12 +02:00
templates Fix hieradata path for puppet 4 2019-02-03 15:45:20 +01:00
tests Add all of the files needed to make this a role 2015-02-22 22:59:39 -05:00
vars Define defaults as defaults, not variables 2016-01-18 19:41:56 -05:00
.gitignore Add tox -eansible-lint support 2015-11-11 21:43:59 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:25:37 +00:00
.zuul.yaml Switch to linters job 2019-05-12 20:20:42 +02:00
LICENSE Add all of the files needed to make this a role 2015-02-22 22:59:39 -05:00
README.md Update README with info about puppet apply 2016-10-20 15:48:40 -07:00
bindep.txt Add bindep.txt file 2018-04-20 14:34:02 -04:00
requirements.txt Add tox -eansible-lint support 2015-11-11 21:43:59 -05:00
run_tests.sh Add all of the files needed to make this a role 2015-02-22 22:59:39 -05:00
test-requirements.txt Add tox -eansible-lint support 2015-11-11 21:43:59 -05:00
tox.ini Fix ansible-lint 2019-05-13 18:30:12 +02:00

README.md

puppet

Run puppet consistently from ansible.

Requirements

puppet needs to be installed on the target node, and if puppet agent is being used, the cert exchange needs to have been performed.

Role Variables

Either puppetmaster or manifest should be supplied. If you are using puppet agent, you want to supply puppetmaster. If you are using puppet apply, you want to supply manifest.

Dependencies

None

Example Playbook using a puppetmaster

The only required argument is puppetmaster:

- hosts: servers
  roles:
     - { role: puppet, puppetmaster: puppetmaster.openstack.org }

Example Playbook without a puppetmaster

The only required argument is manifest:

- hosts: servers
  roles:
     - { role: puppet, manifest: /opt/system-config/production/manifests/site.pp }

License

Apache

Author Information

ansible-puppet is maintained by the OpenStack Infra team. The best way to contact them is on #openstack-infra on freenode.