[ansible-project] Re: ANSIBLE_JINJA2_NATIVE not working in user module for expires key

2022-07-11 Thread senorsmile
It looks like I had a typo as everything is now working. On Monday, July 11, 2022 at 12:07:34 PM UTC-7 senorsmile wrote: > > > I'm trying to pass a generic date to the expires key in the user module > and convert it inline so that our inventory doesn't have to include t

[ansible-project] ANSIBLE_JINJA2_NATIVE not working in user module for expires key

2022-07-11 Thread senorsmile
I'm trying to pass a generic date to the expires key in the user module and convert it inline so that our inventory doesn't have to include this same jinja over and over: ``` users: name: asmith comment: Adam Smith key_exclusive: true key: | abcdefghijklmnopqrstuvwxyz create_use

[ansible-project] equality not consistent

2019-11-29 Thread senorsmile
I assume I'm making some strange error here, but I cannot figure out what the error is. I have a "changed_when" clause I've constructed that never seems to work. However, if I take out the clause into its own debug statement, it seems to work. I have reproduced this with the following ansi

[ansible-project] Re: roles will not run against localhost

2019-10-24 Thread senorsmile
Someone on IRC sorted me out. I needed a tasks folder to put the main.yml into. On Thursday, October 24, 2019 at 8:19:20 PM UTC-7, senorsmile wrote: > > I have some complex aws related tasks that I would like to move into a > role. > However, when I run the play against localho

[ansible-project] roles will not run against localhost

2019-10-24 Thread senorsmile
a role does not (i.e. it never runs the code). I've only tried this on ansible 2.8. Simple repro repo: https://github.com/senorsmile/ansible-localhost-role-broken -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubs

[ansible-project] Re: dirname filter errors

2019-03-20 Thread senorsmile
Never mind. I needed to change the param in debug from var to msg! On Wednesday, March 20, 2019 at 5:27:37 PM UTC-7, senorsmile wrote: > > I have narrowed this issue down to a sample role: > > --- > - set_fact: > testdir: "/some/dir/myfile.txt" > > - debug

[ansible-project] dirname filter errors

2019-03-20 Thread senorsmile
I have narrowed this issue down to a sample role: --- - set_fact: testdir: "/some/dir/myfile.txt" - debug: var: "{{ testdir | dirname }}" I get back the error: fatal: [vagrant_test01]: FAILED! => msg: 'template error while templating string: unexpected ''/''. String: {{/some/dir}}

[ansible-project] Re: aws inventory: `hostname_variable = tag_Name` not working

2019-03-10 Thread senorsmile
This appears to be the PR where this functionality was added: https://github.com/ansible/ansible/pull/7395 On Saturday, March 9, 2019 at 1:57:35 PM UTC-8, senorsmile wrote: > > I haven't used Ansible with AWS for a while. > > I am using it on a new project. I see a newer o

[ansible-project] aws inventory: `hostname_variable = tag_Name` not working

2019-03-09 Thread senorsmile
I haven't used Ansible with AWS for a while. I am using it on a new project. I see a newer option that didn't used to be there: hostname_variable = tag_Name My understanding of this variable is that it will use the Name tag to name the host, while still using the i.p. address as the value

[ansible-project] Re: Copy module

2018-03-07 Thread senorsmile
I have had great success with the synchronize module as of Ansible 2.4. In my opinion, your use case sounds like reasoning to create a custom module. On Wednesday, March 7, 2018 at 11:03:36 AM UTC-8, Malcolm Hussain-Gambles wrote: > > After further investigation it appears there are a lot of

Re: [ansible-project] pretty printing 'complete' dictionary vars in a file after reading from a list of dicts

2018-02-28 Thread senorsmile
I have done similar things. With enough "experimentation", you can get it right. Here's an example from a recent project: --- all: vars: randomkey: "1" # set this first to override {% for k in inventory_data.key1.key2["key3-with-dashes"] -%} {% set v = inventory_data.key1

Re: [ansible-project] Can Ansible consider switching from Google Groups to a Discourse instance?

2018-02-27 Thread senorsmile
I would much prefer google groups to anything else. Please do not change! On Tuesday, February 27, 2018 at 7:12:21 AM UTC-8, Kai Stian Olstad wrote: > > On Monday, 26 February 2018 21.08.42 CET David Reagan wrote: > > > I don't see that, plain text with monospace font is better. > > > > I've b

Re: [ansible-project] Re: ANSIBLE_INVENTORY_ENABLED not picking up values

2017-09-19 Thread senorsmile
Running: ansible all -i inventory/backend/nodes.yml --list-hosts -vvv ansible 2.4.0.0 config file = /Users/shaun/Seafile/scripts/ansible/yaml_inventory/ansible.cfg configured module search path = ['/Users/shaun/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible pyth

[ansible-project] Re: ANSIBLE_INVENTORY_ENABLED not picking up values

2017-09-19 Thread senorsmile
:03:12 PM UTC-7, senorsmile wrote: > > The ansible.cfg doesn't seem to be working either. > > I added the following to ansible.cfg > > enable_plugins = 'host_list', 'script', 'yaml' > > > and now I see these errors: > > ansibl

[ansible-project] Re: ANSIBLE_INVENTORY_ENABLED not picking up values

2017-09-19 Thread senorsmile
ng 'host_list' > [WARNING]: Failed to load inventory plugin, skipping 'script' > [WARNING]: Failed to load inventory plugin, skipping 'yaml' > ERROR! No inventory plugins available to generate inventory, make sure you > have at least one whitelisted.

[ansible-project] ANSIBLE_INVENTORY_ENABLED not picking up values

2017-09-19 Thread senorsmile
As specified here: https://github.com/ansible/ansible/issues/25321 we must now specify the inventory type, making yaml based inventory a higher precedence. I found the new cli env vars here: https://github.com/ansible/ansible/blob/stable-2.4/lib/ansible/config/base.yml I'm trying to overr

Re: [ansible-project] Re: variable_start_string not working

2017-03-17 Thread senorsmile
I'm pondering how difficult it would be to create a filter that allows passing all contents of a variable withOUT interpolating any {{ }} pairs. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receivi

Re: [ansible-project] Re: variable_start_string not working

2017-03-17 Thread senorsmile
I figured as much. And setting that doesn't apply to the task itself, apparently. On Friday, March 17, 2017 at 11:30:04 AM UTC-7, Brian Coca wrote: > > that you set those settings for that specific template, will not > affect Ansible's templating itself, so the with_ will use normal > templa

[ansible-project] Re: variable_start_string not working

2017-03-17 Thread senorsmile
Note that I'm testing the above on 2.2.1. I also tried running from git on tag: v2.3.0.0-0.1.rc1 with the exact same results. On Friday, March 17, 2017 at 11:13:19 AM UTC-7, senorsmile wrote: > > In the docs, there is reference to variable_start_string: > > http://docs.an

[ansible-project] variable_start_string not working

2017-03-17 Thread senorsmile
In the docs, there is reference to variable_start_string: http://docs.ansible.com/ansible/template_module.html Also, you can override jinja2 settings by adding a special header to > template file. i.e. #jinja2:variable_start_string:'[%' , > variable_end_string:'%]', trim_blocks: False which ch

Re: [ansible-project] copy module with hard link destination

2016-04-19 Thread senorsmile
For those who find this same issue in the future, the error will still appear unless you add state: file to the copy module, as documented in here: https://github.com/ansible/ansible-modules-core/issues/468 On Tuesday, November 11, 2014 at 12:26:23 PM UTC-8, Sean McGowan wrote: > > issue #302

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
Ultimately fixed this by simply putting this into the role's defaults/main.yml nagios_host_fqdns_flat: ([]) On Wednesday, August 19, 2015 at 10:20:38 AM UTC-7, senorsmile wrote: > > A! Thanks Serge. So it is applying in the same manner as roles apply > args (e.g. tags: ).

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
A! Thanks Serge. So it is applying in the same manner as roles apply args (e.g. tags: ). So, now to figure out how to default a split(). On Wednesday, August 19, 2015 at 10:09:32 AM UTC-7, Serge van Ginderachter wrote: > > > On 19 August 2015 at 19:02, senorsmile > >

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
essed. I am not being combative, but am I missing something here? That seems like a real bug; the specific bug that I'm running into over and over again. On Wednesday, August 19, 2015 at 9:47:04 AM UTC-7, senorsmile wrote: > > And I've run into this bug yet again! > > I hav

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
t|default([])).split(',')|default([]) }}" register: stat_host_certs This is becoming quite time consuming to insert for every with_* on skipped files!!! On Thursday, August 13, 2015 at 6:09:06 PM UTC-7, senorsmile wrote: > > Ah, great catch. That actually works. > > Now,

[ansible-project] Re: add_host module returns 'NoneType' object has no attribute 'add_group'

2015-08-14 Thread senorsmile
You didn't specify this in your description, but from your naming it is clear you're using add_host after provisioning new aws nodes. I don't believe this is an Ansible issue but an AWS issue. After creating the node, it's takes a little while for the api to respond that it exists (my guess a

Re: [ansible-project] fatal error when skipping includes

2015-08-13 Thread senorsmile
Ah, great catch. That actually works. Now, to convince ansible not to evaluate anything in included files which are skipped... On Thursday, August 13, 2015 at 5:46:11 PM UTC-7, Brian Coca wrote: > > try: > with_items: "{{ ((the_files|default([])).stdout_lines|default([])) | > list }}" >

Re: [ansible-project] fatal error when skipping includes

2015-08-13 Thread senorsmile
I'm not sure I follow you. The include is being skipped since the when: condition isn't met. All other tasks above the one that errs out shows skipped. It's just that specific task that makes everything fail for that host. I have attempted to add a 'default' filter to the when:, but it see

[ansible-project] fatal error when skipping includes

2015-08-13 Thread senorsmile
Error: fatal: [myhost] => with_items expects a list or a set I have a role with the following tasks(snippets included): tasks/main.yml --- - include: server.yml when: icinga_install_mode == 'server' tasks/server.yml --- . - name: Get filenames connection: local shell: find ./roles/ro

[ansible-project] Re: Ansible not pulling in group_vars

2015-07-29 Thread senorsmile
How are you setting the inventory (I assume the hosts folder contain your inventory files). Give us a sample of what's in the inventory files? On Wednesday, July 29, 2015 at 1:29:29 PM UTC-7, datsun80 wrote: > > I moved my inventory files to their own directory and now the group_vars > are not

Re: [ansible-project] Re: jsonfile fact caching error: error, fact_caching_connection is not set, cannot use fact cache

2015-07-29 Thread senorsmile
caching is happening. On Wednesday, July 29, 2015 at 12:42:04 PM UTC-7, Brian Coca wrote: > > docs are wrong, location doesn't exist, i'll fix the docs > > On Wed, Jul 29, 2015 at 3:40 PM, senorsmile > wrote: > > There is no such keyword according to the doc

Re: [ansible-project] Re: jsonfile fact caching error: error, fact_caching_connection is not set, cannot use fact cache

2015-07-29 Thread senorsmile
; > have you tried setting fact_caching_connection? > > On Wed, Jul 29, 2015 at 3:28 PM, senorsmile > wrote: > > I should add that both machines are using ansible 1.9.2. > > > > On Wednesday, July 29, 2015 at 12:27:46 PM UTC-7, senorsmile wrote: > >>

[ansible-project] Re: jsonfile fact caching error: error, fact_caching_connection is not set, cannot use fact cache

2015-07-29 Thread senorsmile
I should add that both machines are using ansible 1.9.2. On Wednesday, July 29, 2015 at 12:27:46 PM UTC-7, senorsmile wrote: > > I have added the following to ansible.cfg > > fact_caching = jsonfile > fact_caching_location = /tmp/ansible_facts > fact_caching_timeout = 86400

[ansible-project] jsonfile fact caching error: error, fact_caching_connection is not set, cannot use fact cache

2015-07-29 Thread senorsmile
I have added the following to ansible.cfg fact_caching = jsonfile fact_caching_location = /tmp/ansible_facts fact_caching_timeout = 86400 With these set, any attempts to use ansible or ansible-playbook (tried multiple different known working playbooks) fails with the error: error, fact_caching_

[ansible-project] Re: ec2 Dynamic inventory and hostname

2015-06-24 Thread senorsmile
+1 this would be awesome. On Monday, June 23, 2014 at 9:25:46 AM UTC-7, Hernandes Sousa wrote: > > Hi, > > I wanted to use the machine hostnames with ec2.py, which I was able to by > customizing the script to return the Name tag for the hostname instead of > the public or private dns name, how

[ansible-project] Re: Populating an EC2 Security Group rules (using ec2_group modules) with IPs (Pingdom probe servers) gathered dynamically at playbook runtime

2015-05-15 Thread senorsmile
Has anyone made any further progress on this yet? On Monday, March 23, 2015 at 4:41:24 PM UTC-7, Steven Truong wrote: > > Thanks for the tips. I tried this and this worked but to only some > extents. > > What do I meant by that and here are the steps that you can repeat to see > the potential

Re: [ansible-project] Variable of variable doesn't work in ansible 1.4

2015-05-11 Thread senorsmile
Dmitry, this is the solution to the ultimate problem I've been having. Thanks On Wednesday, October 29, 2014 at 1:09:02 AM UTC-7, Sankalp Khare wrote: > > I second Giorgio. Dmitry, you're a lifesaver :D > > On Friday, 6 December 2013 03:46:13 UTC-6, Giorgio Crivellari wrote: >> >> >> Dmitry

[ansible-project] can't isolate stdout using register, with_items

2015-04-23 Thread senorsmile
I am attempting to display the debug output of multiple items from a previous resource(including as complete an example as possible; not using roles for this): --- - hosts: - sled1 gather_facts: false tasks: - name: verify ssh from sled1 to all other sleds shell: ssh {{ item }} 'hos

[ansible-project] Re: TypeError: unsupported operand type(s) for +: 'int' and 'str'

2015-03-07 Thread senorsmile
No one has run into this? On Sunday, January 18, 2015 at 4:09:47 PM UTC-8, senorsmile wrote: > > Oddly enough, I CAN run ansible commands, just not playbooks: > > ansible 192.168.1.9 -i hosts -m setup > > > runs just fine. > > > On Sunday, January 18, 2015 a

[ansible-project] Re: TypeError: unsupported operand type(s) for +: 'int' and 'str'

2015-01-18 Thread senorsmile
Oddly enough, I CAN run ansible commands, just not playbooks: ansible 192.168.1.9 -i hosts -m setup runs just fine. On Sunday, January 18, 2015 at 4:02:56 PM UTC-8, senorsmile wrote: > > I am getting some strange errors when trying to run ansible against some > new ubuntu 14.04

[ansible-project] TypeError: unsupported operand type(s) for +: 'int' and 'str'

2015-01-18 Thread senorsmile
I am getting some strange errors when trying to run ansible against some new ubuntu 14.04 boxes. I am using roles that I have already used before and had no issues. I have tried several different roles (including a simple one that simply has a debug message) to no avail. I can still run ansi

[ansible-project] inventory variable range

2014-03-08 Thread senorsmile
I am not quite sure how to do this. E.g. I have a group of hosts www[100:150] and I need to assign their hostnames: ansible_ssh_host = www[100:150].example.com obviously I can't do the above (I did try though). I assume there needs to be some abstraction and some sort of yaml magic ha

Re: [ansible-project] Re: can't access to existing "ansible_eth1" fact

2014-02-04 Thread senorsmile
I am getting the exact same issue as OP. I cloned the official ansible-examples and am trying to deploy the hadoop example. I get part the way through and then get the error: TASK: [common | Create the hosts file for all machines] *** fatal: [hadoop1] => {'msg': "One or

[ansible-project] Re: can't access to existing "ansible_eth1" fact

2014-02-04 Thread senorsmile
On Wednesday, November 6, 2013 8:56:33 AM UTC-8, Jean Philippe Caruana wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I successfully managed to add a private IP address on my servers. I > can see both network interfaces eth0 and eth1 when I ask for the facts > of thi

[ansible-project] can't start service on systemd with ampersand (openvpn@server)

2013-12-23 Thread senorsmile
I'm trying to control openvpn on an arch linux server. I am able to successfully start the service on the box with > systemctl start openvpn@server but when I try to do some from ansible I get: > failed: [laprouter] => {"failed": true, "item": ""} > msg: Failed to issue method call: Unit nam

Re: [ansible-project] Re: playbook: run role only if any previous roles have changes

2013-12-05 Thread senorsmile
;isuid": false, "md5": "d41d8cd98f00b204e9800998ecf8427e", "mode": 420, "mtime": 1386281904.370964, "nlink": 1, "pw_name": "root", "rgrp": true, "roth": true, &quo

Re: [ansible-project] Re: playbook: run role only if any previous roles have changes

2013-12-05 Thread senorsmile
checking of the file exists with stat is done like this: --- - name: Check if path exists stat: path=/etc/monit/conf.d register: check_path - name: It exists debug: msg='Yay, the path exists!' when: check_path.stat.exists On Thursday, December 5, 2013 2:11:25 PM UTC-8, senors

Re: [ansible-project] Re: playbook: run role only if any previous roles have changes

2013-12-05 Thread senorsmile
should probably touch a changed file on the system if something > changes and use when with the stat module. > > -- Michael > > On Dec 5, 2013, at 1:35 PM, senorsmile > > wrote: > > After trying to implement this workaround, I realize that this does NOT > fix my i

[ansible-project] Re: playbook: run role only if any previous roles have changes

2013-12-05 Thread senorsmile
if multiple roles have changes. I need it to only run once at the very end. Still searching for solution to OP... On Wednesday, December 4, 2013 2:44:40 PM UTC-8, senorsmile wrote: > > I have been thinking about this all wrong. I just need to set up a > handler that includes the ym

[ansible-project] Re: playbook: run role only if any previous roles have changes

2013-12-04 Thread senorsmile
, senorsmile wrote: > > I'm trying to come up with a seemingly simple logic, yet can't figure out > how to do it in ansible: > > I want to run the last role only if any previous roles have changes. > -- You received this message because you are subscribed to the Goo

[ansible-project] playbook: run role only if any previous roles have changes

2013-12-04 Thread senorsmile
I'm trying to come up with a seemingly simple logic, yet can't figure out how to do it in ansible: I want to run the last role only if any previous roles have changes. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from t

Re: [ansible-project] new synchronize module: can't specify relative path in playbook

2013-11-22 Thread senorsmile
how to make my own modules. May need to do a full reinstall. On Thursday, November 21, 2013 11:21:41 PM UTC-8, Michael DeHaan wrote: > > I suspect it already knows about your role path and you are specifying too > much, but is that the full output? If so that seems suboptimal and you

[ansible-project] new synchronize module: can't specify relative path in playbook

2013-11-21 Thread senorsmile
I'm trying the following: - name: Ensure adminer installed and up to date > synchronize: > src=roles/mysql/templates/adminer.php > dest=/var/www/adminer.php I first tried just specifying the file name, as it should be automatically found in the templates. I always get a version