Re: [ansible-project] ansible.builtin.copy temp file

2024-06-03 Thread Brian Coca
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

Re: [ansible-project] Multi-conditional when statements

2024-05-30 Thread Brian Coca
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-

Re: [ansible-project] set module_defaults globally?

2024-05-28 Thread Brian Coca
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

Re: [ansible-project] Create a variable based on a variable

2024-05-17 Thread Brian Coca
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

Re: [ansible-project] become sudo not working for apt module

2024-05-14 Thread Brian Coca
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

Re: [ansible-project] Re: become: true does not work but -b works

2024-05-14 Thread Brian Coca
: 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

Re: [ansible-project] how to run play for subgroup when children has same name

2024-04-25 Thread Brian Coca
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

Re: [ansible-project] how to run perticular dependency role for specific host group

2024-04-18 Thread Brian Coca
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

Re: [ansible-project] condition in playbook

2024-04-17 Thread Brian Coca
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

Re: [ansible-project] Failed to load inventory plugin, skipping google.cloud.gcp_compute ansible pluggin

2024-04-10 Thread Brian Coca
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

Re: [ansible-project] Failed to load inventory plugin, skipping google.cloud.gcp_compute ansible pluggin

2024-04-10 Thread Brian Coca
. -- -- 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

Re: [ansible-project] Failed to load inventory plugin, skipping google.cloud.gcp_compute ansible pluggin

2024-04-10 Thread Brian Coca
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

Re: [ansible-project] different log_path per ansible-playbook run?

2024-04-02 Thread Brian Coca
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

Re: [ansible-project] hostvars vs lookup(vars)

2024-03-25 Thread Brian Coca
, 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

Re: [ansible-project] what is the default for DEFAULT_GATHER_TIMEOUT?

2024-03-25 Thread Brian Coca
'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

Re: [ansible-project] Getting past "non-zero return code"

2024-03-21 Thread Brian Coca
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

Re: [ansible-project] Getting past "non-zero return code"

2024-03-21 Thread Brian Coca
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

Re: [ansible-project] Getting past "non-zero return code"

2024-03-21 Thread Brian Coca
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

Re: [ansible-project] hostvars vs lookup(vars)

2024-03-21 Thread Brian Coca
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

Re: [ansible-project] interpolation of loop variables

2024-03-18 Thread Brian Coca
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

Re: [ansible-project] interpolation of loop variables

2024-03-15 Thread Brian Coca
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

Re: [ansible-project] interpolation of loop variables

2024-03-15 Thread Brian Coca
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

Re: [ansible-project] variable misunderstanding

2024-02-06 Thread Brian Coca
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

Re: [ansible-project] What characters are allowed in a vault-id?

2024-01-30 Thread 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

Re: [ansible-project] Ansible Inventory Plugin

2024-01-12 Thread Brian Coca
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

Re: [ansible-project] change of parsing of values? (in ansible.cfg)

2024-01-11 Thread Brian Coca
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

Re: [ansible-project] change of parsing of values? (in ansible.cfg)

2024-01-08 Thread Brian Coca
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

Re: [ansible-project] change of parsing of values? (in ansible.cfg)

2024-01-08 Thread Brian Coca
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

Re: [ansible-project] How to set ansible facts to logs

2024-01-04 Thread Brian Coca
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

Re: [ansible-project] error configuring grub-pc

2023-12-20 Thread Brian Coca
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

Re: [ansible-project] error configuring grub-pc

2023-12-19 Thread Brian Coca
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

Re: [ansible-project] error configuring grub-pc

2023-12-18 Thread Brian Coca
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

Re: [ansible-project] error configuring grub-pc

2023-12-18 Thread Brian Coca
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

Re: [ansible-project] Re: how to encrypt ssh_pass password without asking any more password

2023-12-15 Thread Brian Coca
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

Re: [ansible-project] error configuring grub-pc

2023-11-28 Thread Brian Coca
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

Re: [ansible-project] Error reading config file (/etc/ansible/ansible.cfg): Source contains parsing errors: '' [line 4]: ' 3 \n' #601

2023-11-14 Thread Brian Coca
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

Re: [ansible-project] Error reading config file (/etc/ansible/ansible.cfg): Source contains parsing errors: '' [line 4]: ' 3 \n' #601

2023-11-14 Thread Brian Coca
>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

Re: [ansible-project] Run ansible tasks on hosts one-by-one

2023-11-10 Thread Brian Coca
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

Re: [ansible-project] dynamically set info in hosts file

2023-11-07 Thread Brian Coca
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

Re: [ansible-project] Ansible ping report

2023-11-06 Thread Brian Coca
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

Re: [ansible-project] Ansible ping report

2023-11-06 Thread Brian Coca
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

Re: [ansible-project] Run ansible tasks on hosts one-by-one

2023-11-06 Thread Brian Coca
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

Re: [ansible-project] Run ansible tasks on hosts one-by-one

2023-11-03 Thread Brian Coca
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

Re: [ansible-project] fact disappears after regather

2023-11-03 Thread Brian Coca
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

Re: [ansible-project] Run ansible tasks on hosts one-by-one

2023-11-03 Thread Brian Coca
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

Re: [ansible-project] fact disappears after regather

2023-11-03 Thread Brian Coca
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

Re: [ansible-project] fact disappears after regather

2023-11-02 Thread Brian Coca
. -- -- 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

Re: [ansible-project] fact disappears after regather

2023-11-02 Thread Brian Coca
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

Re: [ansible-project] using a variable from one task in the next

2023-10-31 Thread Brian Coca
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

Re: [ansible-project] Re: how to set different backup directory than current while using backup=yes

2023-10-30 Thread Brian Coca
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

Re: [ansible-project] ansible looking for templates in previous role

2023-10-30 Thread Brian Coca
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

Re: [ansible-project] Re: how to set different backup directory than current while using backup=yes

2023-10-30 Thread Brian Coca
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

Re: [ansible-project] ansible looking for templates in previous role

2023-10-27 Thread Brian Coca
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

Re: [ansible-project] Question regarding no_log = true

2023-10-23 Thread Brian Coca
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

Re: [ansible-project] what is ansible.builtin.file vs just file module

2023-10-20 Thread Brian Coca
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

Re: [ansible-project] Question about using tags

2023-10-16 Thread Brian Coca
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

Re: [ansible-project] Run once on multiple Inventory Hosts with same ansible_host value

2023-10-11 Thread Brian Coca
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

Re: [ansible-project] Question of howto use external variables in the nmap plugin

2023-09-28 Thread Brian Coca
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

Re: [ansible-project] shell module with become_user does not function correctly

2023-09-28 Thread 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

Re: [ansible-project] Howto remove one apt package if the version differ

2023-09-21 Thread Brian Coca
/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

Re: [ansible-project] using a variable from one task in the next

2023-09-21 Thread Brian Coca
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

Re: [ansible-project] Variables on Extra-Vars within Extra-Vars-File

2023-09-14 Thread Brian Coca
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

Re: [ansible-project] Re: Regarding not to proceed further if ansible task fails

2023-09-13 Thread Brian Coca
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

Re: [ansible-project] Ansible and Sops files

2023-09-12 Thread Brian Coca
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

Re: [ansible-project] using every other character in a variable

2023-09-12 Thread Brian Coca
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

Re: [ansible-project] Re: Regarding not to proceed further if ansible task fails

2023-09-12 Thread Brian Coca
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

Re: [ansible-project] Ansible and Sops files

2023-09-12 Thread Brian Coca
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

Re: [ansible-project] Re: Regarding not to proceed further if ansible task fails

2023-09-06 Thread Brian Coca
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

Re: [ansible-project] Re: Ansible 2.15 Warning message

2023-09-06 Thread Brian Coca
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

Re: [ansible-project] Ansible ssh problem (with pfsense)

2023-08-28 Thread Brian Coca
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

Re: [ansible-project] rescue for target failed connection question using localhost

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] rescue for target failed connection question using localhost

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] Re: Don't show all ansible output only show msg output on the console

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] Re: Privilege escalation by rsa key

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] Re: Don't show all ansible output only show msg output on the console

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] Shell module commands runs on Local Controller

2023-08-21 Thread Brian Coca
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

Re: [ansible-project] Loopless alternative?

2023-08-17 Thread Brian Coca
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

Re: [ansible-project] Shell module commands runs on Local Controller

2023-08-17 Thread Brian Coca
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

Re: [ansible-project] ansible does require sudo password (even when key is set up)

2023-08-15 Thread Brian Coca
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

Re: [ansible-project] ansible does require sudo password (even when key is set up)

2023-08-15 Thread Brian Coca
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

Re: [ansible-project] reading the key file contents

2023-08-07 Thread Brian Coca
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

Re: [ansible-project] Correct way to target default inventory with playbook written for localhost

2023-08-07 Thread Brian Coca
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

Re: [ansible-project] restrict playbook execution from specific directory

2023-08-07 Thread Brian Coca
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

Re: [ansible-project] deferred evaluation (?)

2023-07-27 Thread Brian Coca
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

Re: [ansible-project] debconf multiselect is converted to string

2023-07-25 Thread Brian Coca
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

Re: [ansible-project] Calling a secondary inventory file

2023-07-24 Thread Brian Coca
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

Re: [ansible-project] Please help me understand nested loops

2023-07-18 Thread Brian Coca
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

Re: [ansible-project] The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error

2023-07-17 Thread Brian Coca
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

Re: [ansible-project] Passing the var set in the 1st play to 2nd in the single playbook

2023-07-17 Thread 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

Re: [ansible-project] Please help me understand nested loops

2023-07-17 Thread Brian Coca
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

Re: [ansible-project] Re: Access Vault Pass from inside dynamic inventory

2023-07-17 Thread Brian Coca
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

Re: [ansible-project] Unable to reuse ssh connections in Ansible despite PIPELINING = True

2023-07-13 Thread Brian Coca
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

Re: [ansible-project] Unable to reuse ssh connections in Ansible despite PIPELINING = True

2023-07-12 Thread Brian Coca
-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

Re: [ansible-project] How does Ansible work on a technical level?

2023-07-07 Thread Brian Coca
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

Re: [ansible-project] Unable to reuse ssh connections in Ansible despite PIPELINING = True

2023-07-05 Thread Brian Coca
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

Re: [ansible-project] checking to see if cron entry exists

2023-06-28 Thread Brian Coca
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

Re: [ansible-project] Configuration Drift

2023-06-28 Thread Brian Coca
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

Re: [ansible-project] Configuration Drift

2023-06-27 Thread Brian Coca
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

Re: [ansible-project] Ssh connectivity issues from a Debian core server to a remote Windows 10 Pro host.

2023-06-22 Thread Brian Coca
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

Re: [ansible-project] passing arguments to python script

2023-06-21 Thread Brian Coca
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   2   3   4   5   6   7   8   9   10   >