The shell plugin controls that:
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/sh_shell.html#parameter-remote_tmp
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To u
s only a consideration when/if sharing the content.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-
At that point copy the module into a custom one and set the defaults you want.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails fro
center2: datacenter1
vcenter_datacenter: '{{ DCS[vcenter_hostname]|default("datacenter2")
}}' Datacenter
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this grou
FYI, become is independent of modules, it wraps module execution so
modules do not need to enable/support it. Connection plugins on the
other hand can affect how become works, in the case of local, windows
and networking appliances.
--
--
Brian Coca (he/him/yo)
--
You received
: false , but that makes them ALL not work, not
just the task level become.
I cannot tell from the email as it breaks formatting, but my guess
would be that it is set to the task.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
See `select` (or `reject`) filter with `match` test, you can use it to
go over group_names.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving e
Don't use dependencies, use include_role and make it conditional
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, sen
endif %}
An alternative would be:
ansible_distribution: "{{ oracle in job_temp_name|
ternary('RedHat', omit) }}"
patch_enablerepo: "{{ oracle in job_temp_name|
ternary('value', omit) }}"
standard_enablerepo: "{{ oracle in job_temp_name|
terna
I don't know, that is a 'jenkins plugin' question, i can only assert
that the way they execute Ansible is not picking up the collections
you installed, probably due to some configuration it injects.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed
.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion
try running `ansible-doc -t inventory -l` both ways, I suspect jenkins
is not setup to see the installed collection.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from
Most configuration settings are not templatable, but you can always do
it when calling it:
for playname in "play1 play2 play3"; do
ANSIBLE_LOG_PATH="ansilbe.${playname}.log" ansilbe-playbook
"${playname}.yml"; done
--
--
Brian Coca (he/him/yo)
--
You rec
, so we return the original template.
Using the vars directly in the context of the host elsewhere will '
just work'TM as there the rest of the vars exist in that context.
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Pr
'default_gather_timeout'.
I hope this helps.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-projec
he, you'll need the same condition for debug (or use a block) since
debug the way you set it up returns `rc: 1` and fools it into thinking
there is an error.
You can also bypass the top level rc with msg={{ 'out: ' ~ out }}
--
--
Brian Coca (he/him/yo)
--
You received this message
when asking for help it is useful to show the full task and -vvv
output that includes the error (like your first post). It is hard to
debug from just a partial message out of context.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google
You can control the failure handling from the task using
'failed_when', for example:
failed_when: out is failed and not out.rc == 1
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubs
Both are valid approaches but do different things, hostvars will
provide a untemplated subset of what you can get through the vars
lookups for the case of 'inventory_hostname', but the lookups do not
currently expose hostvars for other hosts.
--
--
Brian Coca (he/him/yo)
--
You
the first target for
removal.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-projec
also varnames lookup
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit
You can also use the vars lookup: lookup('vars', item), which has
broader scope over hostvars.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiv
backups.postgresql does not exist, it is backups[1]
To get what you want the data would have to look like this:
backups:
mongodb
postgresql:
- sonarqube
- other
"/opt"
"/etc"
--
--
Brian Coca
No explicit limitations exist, but now that you ask I'm thinking there
should be.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails fro
either the auto (which will try to find your custom plugin) or your
custom plugin need to be enabled.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
It should not break again, the code had 'ini' source detection broken,
since it was looking for 'ini' as origin, but we set
'/path/to/ansible.cfg' instead, so it was not matching.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
sorry, yes, that pr above broke it, this one should fix it
https://github.com/ansible/ansible/pull/82388
my brain just came back from vacation and reminded me
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"An
Not really, only thing I can think of is this PR
https://github.com/ansible/ansible/pull/79837, but ini should have
kept the old behavior.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To u
The simplest way would be a callback, the `tree` callback already does
something similar, I don't know if any of the existing do exactly what
you want, but it should be easy to modify the `tree` one to do so.
--
--
Brian Coca (he/him/yo)
--
You received this message because you
The module requires the utils, but the debconf CLI itself does not and
should already be installed.
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiv
that should be good, the other is probably the resolved path from a
symlink (/dev/ does this a lot)
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
Sorry, I meant debconf, not dpkg_selections (not sure why I keep
confusing those), here is an example of me doing the same for
installing java package.
https://github.com/bcoca/ansible-oracle_java7-role/blob/master/tasks/main.yml#L17
--
--
Brian Coca (he/him/yo)
--
You received
this.
--
--
Brian Coca (he/him/yo)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion
SSH_ASKPASS also requires DISPLAY (X11 working) so it is not really viable
option for Ansible as it is often run from a configuration server/instance
that rarely has X11 installed.
But if you have such an environment you should be able to set it up that
way.
--
Brian Coca
--
You
See dpkg_selections module to PRE populate answers/settings for
packages when there are no defaults or (like your case) the defaults
do not work.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dpkg_selections_module.html
--
--
Brian Coca
--
You received this message
You can use `ansible-config` both to verify the file and to generate one.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
>I think that's because your Ansible config file is too old.
>It's old format.
The ansible.cfg file format has not changed since 0.4, new options
have been added but the format has always been the same.
--
--
Brian Coca
--
You received this message because you are subs
Pllaybooks can contain plays, plays can contain tasks, blocks and
roles, but you cannot reverse the direction of 'containers'.
You CANNOT have a play in a role, so your question is a non starter.
You have to write a playbook with multiple plays.
--
--
Brian Coca
--
You received
You have 3 hosts involved, but you do not clarify which one you are
updating: controller, bastion or target?
I'm guessing you are using the play pointing at the target, but you
probably need to delegate the task to the controller (aka localhost).
--
--
Brian Coca
--
You received
sorry, had only read the bottom, too used to people making that
mistake, but you did not.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails fro
Not all modules return a stdout nor stdout_lines, ping is one of them,
it returns 'data', check the RETURN DOCS for each module to know the
structure of the registered var they return.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
roles can be in plays, plays cannot be in roles
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-projec
Put the tasks in a play, you can have multiple plays per playbook
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
No, the cfg setting affects 'fact gathering' but not specific module
executions, you executing the 'setup' module or any other that returns
facts is not exactly the same thing.
Use module_defaults or just set the local facts dir when you invoke setup.
--
--
Brian Coca
--
You
serial is a PLAY level keyword and what you want to use in this case,
throttle will only control the forks/parallel jobs, not serialize a
batch (this is what serial does).
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Pr
I cannot reproduce, either both have it defined or undefined
(depending if i add /etc/ansible/facts.d/fstab.fact or not).
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this grou
.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web vi
Fact gathering overwrites all facts for a host, it does not update.
ansible_local is actually a subset of the facts gathered, it is
updated to what ansible_facts['local'] returns.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"An
in play2 just use `hostvars['localhost']['server_list']`
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansib
This is an example role I made https://github.com/bcoca/local_backup.
this is just ONE way to do it. If using awx/Tower/Controller I would
recommend creating a workflow.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Pr
base functionality in backwards incompatible ways, any
issues with mitogen can be address at it's own issue site.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
if a backup is
needed until after the task that creates the backup runs, mtime is not
the best indicator.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails fro
e network. Todd, I'll look again at when I use the chrony tasks.
>
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to an
ts
can see it.
Environment variables are slightly better, but I don't know enough about
vinyl to give you alternatives.
--
------
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and s
sed/thought of.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view th
You can use both, just be aware that when in conflict skip-tags has
precedence over tags.
but looking at docs, we don't seem to have specified that nor have any
examples, someone should fix that.
--
--
Brian Coca
--
You received this message because you are subscribed
No need for lockfiles, I would use groups instead. Setup a group that
has one instance of inventory_hostname per ansible_host, then target
that group when you want to do 'single operation per real host'. for
'all' just use the all group.
--
--
Brian Coca
--
You received this message
The basic configuration items are not templatable at all as no vars
were accessible when designed, extra vars got added later for
'constructed' features.
We do have plans to make this work, specially with vaults (you can
vault the file, but not use inline vaults).
--
--
Brian Coca
become does not always imply a full login nor sourcing .shell files,
some of it depends on flags (`-i` for sudo or `-` for su), other times
it depends on shell used.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project&q
/version_test.html
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this
You are confusing scopes, `set_fact` is PER HOST, not a global. So you
defined the variable on server1 but are trying to read it from
127.0.0.1.
So to access in the 2nd play you need to go through hostvars:
{{hostvasr['server1']['reg_name']
--
--
Brian Coca
--
You received this message
No, buton the other hand... its still shell:
ansible-playbook -i localhost -e "test=var1
some=${THIS_IS_AN_ENV_VAR}" -e
"@files/dev/sample_${THIS_IS_AN_ENV_VAR}.yml"
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
&qu
Not in the part you are showing, but the output you showed has `ignoring
..` which you only get with that keyword.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
You are trying to use a vars file as an inventory also, that is why
you are getting those warnings. move it into a host_vars or group_vars
directory instead
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project&q
se objects.
--
------
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on
from the output you have EXPLICIT ignores to the failures, that is why
Ansible is continuing to more tasks, remove the ignores if you don't want
the failure to be ignored.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Pr
You do not give enough details, the message seems to indicate
malformed YAML, could you show the files involved?
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
This is the default behavior, if task #1 fails, subsequent tasks will
not run for that host. In the previous response they point you on how
to continue on error, the implication being the default is to stop on
error.
--
--
Brian Coca
--
You received this message because you
collection. I would open an issue in here
https://github.com/ansible-collections/ansible.netcommon/issues
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving e
The problem is the python on the target, not the controller
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansib
differently.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion
I just did something very similar:
- name: Check Nodes
hosts: all
gather_facts: false
tasks:
- name: ping hosts
ping:
ignore_errors: True
ignore_unreachable: True
register: ping_results
- hosts: localhost
gather_facts: false
tasks:
- name: Add failed hosts to
Simple example, if you just want to override task output:
def v2_runner_on_ok(self, result):
if result._task.action != 'debug':
return
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Pr
escalation
w/o sshing in.
- The already mentioned junk become password
- Modify/create a custom sudo become plugin to take a new option
(ignore_password_prompt=false|true) to avoid raising the error.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
Or just use a custom callback that only outputs debug entries.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansib
shell and command require python on the remote, try raw instead
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansib
see map/select/reject filters .. they are actually loops and normally
much simpler than using jinja command syntax ( {% %} ).
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this grou
That is becase 'connection: local' forces using the 'local' connection
plugin, which means that instead of executing on the target it 'forks
locally' to execute the module.
Just remove it, 99% of the time you do not need to specify `connection`.
--
--
Brian Coca
--
You received
You are connecting as `simon`, not `groovy`, which might explain the
password requirement for sudo.
This is your config file /home/simon/Documents/IaC/ansible.cfg, make
sure the setting is correct (ansible-config dump --only-changed should
help with that).
--
Brian Coca
--
You
An example and the -vvv output when hitting the issue might be
helpful for other to diagnose your issue.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiv
is not trivial and the reason the ssh connection plugin does
not attempt to do so.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
Try updating the play to `hosts: all` or change 'all' for the group of
your inventory you want to target. 'localhost' is special so just
changing `ansible_host` is not enough.
https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
--
--
Brian Coca
--
You received
plugin you always load (callback/connection/?).
- Use a wrapper script or shell alias function that does the check and
then calls the 'real' Ansible CLI.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To u
try the template lookup
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.co
open a bug, value should be 'raw' and we should convert depending on type:
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
See `meta:
refresh_inventory`https://docs.ansible.com/ansible/latest/collections/ansible/builtin/meta_module.html#parameter-free_form
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubs
The way 'with_' works is more or less the same a a loop with a lookup
in it's item list
with_nested ... == loop: '{{ lookup("nested", ... )}}'
Most find the `loop` syntax a bit clearer, it is less 'magical', but
the with_ syntax is more convenient.
--
------
Brian Coca
--
Yo
First, the ping module is not an icmp/networking ping, it is a 'can
Ansible execute on this machine'. it involves logging in and using a
version of Python that can return a JSON string.
The error message is giving you the solution, define the Python to use
on the remote.
--
--
Brian Coca
how?
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this
This is really not a 'nested' loop, you are using the 'subelements'
lookup to change the data provided to a single loop.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this grou
ignoring errors.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this
Ansible already does this per per task, this still just uses 'shared
auth' in the case of ssh, not full session (unlike winrm/prsp). In any
case this feature would be 'across tasks' or block of tasks.
--
--
Brian Coca
--
You received this message because you are subscribed
-connection on controller otherwise.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.co
as JSON and outputs JSON with some required fields,
which should be doable in any/all programming languages.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving e
A few things:
- pipelining is not about connection reuse but about writing to disk
- for ssh connection plugin, the control persist settings are what
reuse connections/authentication, but not sessions
- the synchronize action does it's own connection handling
--
Brian Coca
--
You
If you want to just see if things 'would change':
`check_mode: true`
not all modules support it, but both cron and lininefile modules say they do
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubs
Ansible CAN do many things, does not mean it should, see this old
presentation where i show an example of 'file alteration monitoring'
https://www.slideshare.net/bcoca/ansible-tips- tricks slide 15
(cowsay kitty mentions aide/osiris/tripwire).
--
--
Brian Coca
--
You received
to verify things, instead of using something like
inotify to trigger immediate response from a passive kenrel hook (via
fam deamon or something as simple as incron). This ends up being a LOT
more efficient and avoids a lot of useless processing.
--
--
Brian Coca
--
You received this message
Did you follow
https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html#windows-ssh-setup
?
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving e
The difference between a 'python list' ( [item, item2] ) and a 'shell
list' `item item2`, as @Dick Visser shows a simple join can translate
one to the other.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project&q
1 - 100 of 3217 matches
Mail list logo