Commit Graph

10 Commits

Author SHA1 Message Date
Monty Taylor 24eb60b34d
Reorganize hieradata to match ansible variables
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
2018-08-02 13:11:29 -05:00
Colleen Murphy 4d64868882 Don't hardcode puppet-3-specific config paths
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
2018-04-22 00:13:21 +02:00
Jeremy Stanley 10e657d56d Correct AnsibleModule string type names to str
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
2016-07-23 22:53:06 +00:00
Paul Belanger b8e3bdd1fd
Be explicit with AnsibleModule types
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>
2016-07-18 14:35:12 -04:00
Jenkins b5fc21ca37 Merge "Call main() from a conditional" 2016-06-06 13:02:06 +00:00
Paul Belanger b6ebba9545
Call main() from a conditional
See ansible docs[1] for more information.

[1] http://docs.ansible.com/ansible/developing_modules.html

Change-Id: I21062e1eb47632ac39e35d7267dab96b62500743
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-05-26 13:31:11 -04:00
Spencer Krum 652c192d7f Remove dead code
This variable assignment is wiped out by the next statement, remove it.

Change-Id: Ibc042d6a98170646f03fc00a8ffd16d9f9cce9f4
2016-02-10 19:27:05 -08:00
Monty Taylor 69cf3cd23c module is a variable, not a name prefix
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
2016-01-18 19:14:36 -05:00
Monty Taylor c25e5aa543 Perform filepath checking in python
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
2016-01-14 15:39:25 -05:00
Monty Taylor c424d8b555 Copy in matching hiera files
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
2015-11-11 14:59:35 -08:00