We are already organizing our hiera content basically the same way as
ansible needs for variables to be provided. If we reorganize the
directories slightly (to be coordinated with dirs on puppetmaster)
then we can have a single directory do double-duty.
Change-Id: I6ac90a7439ed8a5d9433d9526f37e44668b360ff
This patch ensures that hiera data and puppet modules, and puppet config
are copied to the right directory depending on the current puppet
version. Since it's possible for the ansible management server and the
managed nodes to have different puppet versions, we need to account for
the possibility that the source and destination paths might be
different. We also don't need to hardcode the various config paths in
config or manage environments since we're using the defaults and
hardcoding them would make them incorrect for one or the other puppet
versions.
Change-Id: I164f91f9a7942e8c5f059652634ec1078ae41aae
The valid type names can be found in
AnsibleModule._CHECK_ARGUMENT_TYPES_DISPATCHER, and any deviation
from those causes us to no longer be able to puppet any hosts. The
type name for strings is, courtesy of Ansible's implementation being
Python, "str".
Change-Id: Ia4d4cde9926f7506a864739b1b616438c5fe6f43
When moving to ansible 2.1.0.0, we'll need to be more explicity about
our AnsibleModule parameters. Ansible now defaults them to strings.
This will ensure groups is a list.
Change-Id: Ic126c200a432277c0ef406d4406f527d6a3c9fa7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Turns out we want module.exit_json, not module_exit_json. Oops. Also,
two other small ansible task cleanups found looking at the runs.
Change-Id: I8737d5b1e675bfb89ee1db2f2c434c601d419f5e
Checking for all of the paths in ansible leads to a TON of skipped lines
in the ansible log. That's not good for anybody, and we're already
processing the paths in python - let's do a quick filter to check for
which ones exist before returning them.
Change-Id: Iddf3c56c802598329a18c374cf667a6f165f78ca
Find any files that match common, $fqdn and $group in the hiera
structure and copy them to the target host's hiera structure so that
the puppet apply command can operate.
Change-Id: I833858e86b9e8fe0750642476f118ca7d0358380