Commit Graph

30 Commits (1c36665545ab3ceb7b5edb998a9b83eb8f6be133)

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
9 years ago
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.
9 years ago
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
9 years ago
René Moser aeb82091a6 Merge pull request #1634 from EmilienM/puppet/certname
system/puppet: add --certname parameter
9 years ago
Brian Coca df217fe892 added new puppet path to bin search
fixes #1835
9 years ago
Jonathan Mainguy deb72106d2 fixes bug where puppet fails if logdest is not specified 9 years ago
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
9 years ago
James Cammarata 816d3bff6f Adding version_added field to logdest field for puppet module 9 years ago
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.
9 years ago
Dale Smith 27cd172900 Fix regression of #821 in puppet of show_diff
Issue #821 fix: 1382576100
Regressed since: 6912ca0aca

Issue: #821
9 years ago
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
9 years ago
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
9 years ago
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.
9 years ago
Jonathan Mainguy 83f4f16235 Enable stdout and stderr on sucessful runs, making show_diff useable
omit color symbols as ansible makes them illegible
9 years ago
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
9 years ago
Brian Coca 767ec29640 Merge pull request #1260 from xavpaice/devel
Added stdout and stderr to puppet output for rc=2
9 years ago
Brian Coca 367b88a2ab removed json import 9 years ago
Xav Paice c1cf8e671a Added stdout and stderr to puppet output for rc=2 9 years ago
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.
9 years ago
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 9 years ago
Brian Coca 1382576100 fixed a few typos
fixes #821
9 years ago
Rene Moser f33bbe6e49 puppet: update author to new format 10 years ago
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
~~~
10 years ago
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
}
~~~
10 years ago
Rene Moser 616a56f871 puppet: add --environment support 10 years ago
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.
10 years ago
Monty Taylor ce93a91a59 Fix octal values for python 2.4 10 years ago
Monty Taylor e7ed08f762 Add support for check mode 10 years ago
Monty Taylor a1ecd60285 Fix some errors pointed out by travis 10 years ago
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
10 years ago