Commit graph

30 commits

Author SHA1 Message Date
Monty Taylor
38c8fec277 Merge pull request #1149 from Jmainguy/puppet_stdout
Enable stdout and stderr on sucessful runs, making show_diff useable
2016-04-10 08:43:39 -07:00
Vlad Gusev
f1175693f6 system/puppet: add --tags parameter (#1916)
* system/puppet: add --tags parameter

--tags [1] is used to apply a part of the node’s catalog.

In puppet:
puppet agent --tags update,monitoring

In ansible:
puppet: tags=update,monitoring

[1] https://docs.puppetlabs.com/puppet/latest/reference/lang_tags.html#restricting-catalog-runs

* Add example of tag usage.

* system/puppet: add list type for a tags dict.
2016-04-10 11:14:48 +02:00
Emilien Macchi
c289aa4cb9 system/puppet: allow to run puppet -e
-e or --execute [1] allows to execute a specific piece of Puppet code
such a class.

For example, in puppet you would run:
puppet apply -e 'include ::mymodule'

Will be in ansible:
puppet: execute='include ::mymodule'

[1] http://docs.puppetlabs.com/puppet/latest/reference/man/apply.html#OPTIONS
2016-03-17 13:04:24 -04:00
René Moser
aeb82091a6 Merge pull request #1634 from EmilienM/puppet/certname
system/puppet: add --certname parameter
2016-03-16 22:38:04 +01:00
Brian Coca
df217fe892 added new puppet path to bin search
fixes #1835
2016-03-11 10:14:15 -05:00
Jonathan Mainguy
deb72106d2 fixes bug where puppet fails if logdest is not specified 2016-03-05 14:08:28 -05:00
Emilien Macchi
6193ed4b0d system/puppet: add --certname parameter
certname [1] can be a useful parameter when we need to specify a
certificate name different from the default value [2] in Puppet.

Ex: the hosts have different names, in advanced network isolation
setups.

Also, it can be used when we want to run Puppet with a specific node
definition and not using hostname or fqdn to match the nodes where we want to
run Puppet [3] (not recommended by Puppetlabs though).

[1] https://docs.puppetlabs.com/puppet/latest/reference/configuration.html#certname
[2] Defaults to the node’s fully qualified domain name
[3] http://docs.puppetlabs.com/puppet/latest/reference/lang_node_definitions.html#naming
2016-02-22 20:21:17 -05:00
James Cammarata
816d3bff6f Adding version_added field to logdest field for puppet module 2016-02-09 14:37:15 -05:00
Monty Taylor
e704525d46 Add option to send puppet apply logs to syslog
While returning puppet logs as ansible stdout is useful in some cases,
there are also cases where it's more destructive than helpful. For
those, local logging to syslog so that the ansible logging makes sense
is very useful.

This defaults to stdout so that behavior does not change for people.
2016-02-09 10:38:56 -06:00
Dale Smith
27cd172900 Fix regression of #821 in puppet of show_diff
Issue #821 fix: 1382576100
Regressed since: 6912ca0aca

Issue: #821
2016-01-28 15:48:18 +00:00
Toshio Kuratomi
d6af6f8477 Update for modules which import json.
Some do not use the json module directly so don't need import json.
Some needed to fallback to simplejson with no traceback if neither was installed

Fixes #1298
2016-01-11 13:06:22 -08:00
Jonathan Mainguy
a58b847d5c Remove advertising show_diff feature
--diff will be added to more modules soon, and we want puppet module to utilize this instead of show_diff
2016-01-06 10:04:55 -05:00
Casey Lang
3de4f10bb5 Fix puppet module formatting issue
The `->` in the `show_diff` option doc seemed to be causing the docs
page to break. Not sure why, since it was still valid YAML.
2016-01-05 18:22:38 -06:00
Jonathan Mainguy
83f4f16235 Enable stdout and stderr on sucessful runs, making show_diff useable
omit color symbols as ansible makes them illegible
2015-12-15 11:36:55 -05:00
Monty Taylor
6912ca0aca Sync minor fixes from OpenStack Infra
Infra has been keeping a local copy of this waiting for ansible 2 to
release. In getting ready for ansible 2 (and our ability to delete our
local copy of the file, I noticed we had a couple of minor cleanups.

Also, the timeout command is there to improve life and workaround puppet
deficiencies. However, it's not working around deficiencies on systems
that do not have the timeout command if we blindly use it.

The puppet specific timeout options are more complex and out of scope of
this.

Issue: #1273
2015-12-14 23:40:01 -05:00
Brian Coca
767ec29640 Merge pull request #1260 from xavpaice/devel
Added stdout and stderr to puppet output for rc=2
2015-11-24 12:51:14 -08:00
Brian Coca
367b88a2ab removed json import 2015-11-21 16:07:12 -08:00
Xav Paice
c1cf8e671a Added stdout and stderr to puppet output for rc=2 2015-11-18 14:34:46 +13:00
Monty Taylor
ea5af4c27a Revert "Change show_diff to default to yes"
This was originally to match what puppet agent --test is, since the
rest of the options defaulted to on are grabbed from --test. However,
some security concerns have since been raised - namely that since this
is not the same invocation as --test but instead a remote orchestration
of puppet, the fact that passwords leak into the diff is a dangerous
default.

This reverts commit b86762c180.
2015-11-01 10:50:58 +09:00
Jonathan Mainguy
b86762c180 Change show_diff to default to yes, to match what puppet agent --test is, since the rest of the options defaulted to on are grabbed from --test 2015-10-23 13:24:39 -04:00
Brian Coca
1382576100 fixed a few typos
fixes #821
2015-08-10 13:25:13 -04:00
Rene Moser
f33bbe6e49 puppet: update author to new format 2015-06-16 11:33:16 -04:00
Rene Moser
e633d9946f puppet: make arg puppetmaster optional
puppetmaster was used to determine if `agent` or `apply` should be used. But puppetmaster is not required by puppet per default. Puppet may have a config or could find out by itself (...) where the puppet master is.

It changed the code so we only use `apply` if a manifest was passed, otherwise we use `agent`.

This also fixes the example, which did not work the way without this change.

~~~
# Run puppet agent and fail if anything goes wrong
- puppet
~~~
2015-06-16 11:33:15 -04:00
Rene Moser
c277946fb3 puppet: fix missing space between command and arg
Fixes:
~~~
{
    "cmd": "/usr/bin/puppetconfig print agent_disabled_lockfile",
    "failed": true,
    "msg": "[Errno 2] No such file or directory",
    "rc": 2
}
~~~
2015-06-16 11:33:15 -04:00
Rene Moser
616a56f871 puppet: add --environment support 2015-06-16 11:33:15 -04:00
Rene Moser
9d4046f44b puppet: ensure puppet is in live mode per default
puppet may be configured to operate in `--noop` mode per default.

That is why we must pass a `--no-noop` to make sure, changes are going to be applied.
2015-06-16 11:33:15 -04:00
Monty Taylor
ce93a91a59 Fix octal values for python 2.4 2015-06-16 11:33:12 -04:00
Monty Taylor
e7ed08f762 Add support for check mode 2015-06-16 11:33:12 -04:00
Monty Taylor
a1ecd60285 Fix some errors pointed out by travis 2015-06-16 11:33:11 -04:00
Monty Taylor
9d2d3f0299 Add module to run puppet
There is a growing pattern for using ansible to orchestrate runs of
existing puppet code. For instance, the OpenStack Infrastructure team
started using ansible for this very reason. It also turns out that
successfully running puppet and interpreting success or failure is
harder than you'd expect, thus warranting a module and not just a shell
command.

This is ported in from
http://git.openstack.org/cgit/openstack-infra/ansible-puppet
2015-06-16 11:33:11 -04:00