[ansible-project] Re: ec2_vpc_route_table and gateways vs peering

2019-08-10 Thread Barry Kaplan
Something like this in `ensure_routes` where it collects the routes to purge if purge_routes_exclude_pcx and r.get('VpcPeeringConnectionId') and r['VpcPeeringConnectionId'].startswith('pcx-'): continue if purge_routes_exclude_igw and r.get('GatewayId') and

[ansible-project] Re: ec2_vpc_route_table and gateways vs peering

2019-08-10 Thread Barry Kaplan
My assumption was incorrect. The module does not make any special considerations for gateways. Which leaves the problem of retaining certain routes without having to use purge=false. I don't want to use purge=false because that leaves us to manually clean up the routes. And we need to add

[ansible-project] ec2_vpc_route_table and gateways vs peering

2019-08-10 Thread Barry Kaplan
It seems that ec2_vpc_route_table will not purge igw or nat gateways even if purge=true, which is very nice. But it DOES purge routes associated with peering. Shouldn't peering routes be treated in the same as gateways? -- You received this message because you are subscribed to the Google

Re: [ansible-project] Cannot decrypt on ubuntu

2019-08-01 Thread Barry Kaplan
I was running `file` just to show the they were ascii. But thanks, because I *thought* the files where the same. Indeed I was sure. But of course they are not. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

[ansible-project] Cannot decrypt on ubuntu

2019-08-01 Thread Barry Kaplan
I am working with a project on a new ubuntu installation. On osx I can use ansible-vault correctly, but on ubuntu I always get (ansible-2.8) ansible❯ ansible-vault -v --vault-password-file=~/.ansible/ vault-password view inventory/aws/ops/group_vars/all/vault_ops.yml Using

[ansible-project] failure to parse `environment`

2018-12-17 Thread Barry Kaplan
I am running - name: Install logstash {{ logstash_apt_version }} apt: pkg: "logstash={{ logstash_apt_version }}" state: present force: "{{ logstash_apt_force | default(false) }}" environment: "{{ logstash_environment | default(omit)

Re: [ansible-project] Cannot get python to see psycopg2 on OSx

2018-12-10 Thread Barry Kaplan
Dick, you are saying that /usr/local/bin/pip is installing modules in the wrong place? Why would that be? -- 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] Cannot get python to see psycopg2 on OSx

2018-12-09 Thread Barry Kaplan
I've been pounding my head on this for a few hours now. Nothing I do can get python to import psycopg2. Consider: - name: Setup mysql databases hosts: localhost connection: local become: no tags: [database, postgres] gather_facts: no pre_tasks: - debug:

Re: [ansible-project] Is there any way to write a module that does 'remove_host' or 'replace_hosts'?

2018-11-14 Thread Barry Kaplan
Bummer, but thanks Brian. -- 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 post to this group, send email to

[ansible-project] Is there any way to write a module that does 'remove_host' or 'replace_hosts'?

2018-11-14 Thread Barry Kaplan
I have plays that look like, eg - name: provision ec2 instance ... - set_fact: newly_created_ips: ... - import_playbook: ../configure/nomad-server.yml Inside nomad-server.yml it looks like - name: Configure nomad-client hosts: nomad_client ... What I want is to "dynamically" limit

[ansible-project] Re: Is there any way to select a single host when using a pattern?

2018-11-04 Thread Barry Kaplan
Well, there is this - run_once: true block: - ... But can it be done via the host pattern? -- 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

[ansible-project] Is there any way to select a single host when using a pattern?

2018-11-04 Thread Barry Kaplan
hosts: group_a[0] works, but this does not hosts: group_a:_b[0] is there any way to achieve the second without having to put `run_once` on every task? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

[ansible-project] hostvars[some_ip] does not contain `ansible_hostname`

2018-11-03 Thread Barry Kaplan
Why would this be? It has lots and lots of ansible_* variables, but some others like ansible_hostname or ansible_mounts. This is not the case for hosts though, just some. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

[ansible-project] Re: Undefined variable when using lookup('dict', hostvars) or map('extract', hostvars)

2018-11-03 Thread Barry Kaplan
Here is what I did to get my results. Seems smelly but works. - debug: msg: - "{{ item }}" with_subelements: - "{{ groups[host_group] | map('extract', hostvars) | dicts_pick(['ec2_id', 'ansible_hostname', 'ansible_mounts']) }}" - 'ansible_mounts' with

[ansible-project] Re: apt result is changed incorrectly?

2018-10-24 Thread Barry Kaplan
I posted the non-wildcard version above. But that too marks the task as changed. Which then is very different from what I would expect. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

[ansible-project] Re: apt result is changed incorrectly?

2018-10-24 Thread Barry Kaplan
Sorry, posted the wrong version expression - name: Install python apt: name: python2.7='2.7.14*' state: present update_cache: yes register: _apt_python - debug: var=_apt_python - fail: -- You received this message because you are subscribed to

[ansible-project] apt result is changed incorrectly?

2018-10-24 Thread Barry Kaplan
I am running apt with a wildcard. The package is not being installed/updated, but task is marked as changed. Is this is a bug or how I should expect apt to work with a wildcard. ansible❯ ansible --version ansible 2.6.5 - name: Install python apt: name:

Re: [ansible-project] [WARNING]: Module remote_tmp /root/.ansible/tmp did not exist and was created with a mode of 0700

2018-10-17 Thread Barry Kaplan
What would be the "correct permissions" in this case? -- 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 post

[ansible-project] Re: using rule_desc with ec2_group will always clear the rules on the first run

2018-10-08 Thread Barry Kaplan
I find that when I change a rule_desc I get an error An error occurred (InvalidPermission.NotFound) when calling the > RevokeSecurityGroupIngress operation: The specified rule does not exist in > this security group." > Immediately rerunning the play and ec2_group shows no change. So the

[ansible-project] using rule_desc with ec2_group will always clear the rules on the first run

2018-10-08 Thread Barry Kaplan
I just recently discovered `rule_desc`. So upon adding the description to some plays I am seeing the behavior that the first time `ec2_group` is executed with the rule description, all rules (or at least the rules with the descriptions) are removed. Only on the second run of `ec2_groups` are

[ansible-project] mysql_db does not "see" MySQL-python module

2018-09-04 Thread Barry Kaplan
I have tasks: - name: Install the Python MySQLB module pip: name=mysql-python - name: Create grafana database tags: [mysql] mysql_db: state: present name: "{{ vault_grafana_db_name }}" login_host: "{{ data_rds_mysql_host }}"

[ansible-project] --tags not propagating thru a play include

2017-08-31 Thread Barry Kaplan
I have a playbook that includes lots of other playbooks, eg # site.yml - include: mesos-master.yml - include: mesos-slave.yml Inside mesos-master.yml for example, I have play that looks like - name: Configure logging hosts: mesos_master become: yes tags: [logging] roles: - role:

Re: [ansible-project] Need help with deprecation warnings

2017-02-28 Thread Barry Kaplan
Sorry, I was wrong. This does indeed remove the warning. On Tuesday, February 28, 2017 at 5:44:37 PM UTC+1, Barry Kaplan wrote: > > This does not remove the deprecation warning for me in 2.1.2.0 > > On Saturday, September 10, 2016 at 10:19:34 AM UTC+2, Kai Stian Ols

Re: [ansible-project] Re: "when" and "with_items" again, with a twist

2017-02-28 Thread Barry Kaplan
Thanks Brian. Just saw that example in another post. It does work of course, but boy is it ugly. -- 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] Re: "when" and "with_items" again, with a twist

2017-02-28 Thread Barry Kaplan
Anybody figure out to get around these deprecation warnings? -- 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

Re: [ansible-project] Need help with deprecation warnings

2017-02-28 Thread Barry Kaplan
This does not remove the deprecation warning for me in 2.1.2.0 On Saturday, September 10, 2016 at 10:19:34 AM UTC+2, Kai Stian Olstad wrote: > > This will work. > First project_config need to be filtered through default, and then > project_config.apt. > >with_items: " {{ (project_config |

[ansible-project] Re: mysql_db won't use given password

2016-08-10 Thread Barry Kaplan
User error, but not so informative error message. My instance security group was not updated to have access to the database. -- 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,

[ansible-project] mysql_db won't use given password

2016-08-10 Thread Barry Kaplan
I have not run any plays with mysql_db since upgrading to 2.x. But now I keep getting TASK [Create mysql database] *** fatal: [10.0.192.187]: FAILED! => {"changed": false, "failed": true, "msg": "unable to find /root/.my.cnf. Exception message:

[ansible-project] Re: Content low error message

2016-07-19 Thread Barry Kaplan
Ok, this is only with 2.2.RC3. No error with 2.1.0.0. -- 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 post

[ansible-project] Content low error message

2016-07-19 Thread Barry Kaplan
I am getting these errors. This is the output with -vvv. Would really be helpful the variable that is not defined was identified. Anybody have idea how to debug this? (ansible 2.2.RC3) TASK [setup] *** fatal: [10.0.16.156]:

Re: [ansible-project] Still in 2.1?: Nested values always cast to string

2016-06-29 Thread Barry Kaplan
So if I understand Brain, that when passing dict (created from yaml) into a module or plugin, the python code must be aware of all the types of all the properties (flat or nested) and do the cast itself. This is really fine for a module that consumes values itself. But in an example where the

Re: [ansible-project] Still in 2.1?: Nested values always cast to string

2016-06-28 Thread Barry Kaplan
Single quotes makes no difference. -- 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 post to this group, send

[ansible-project] Still in 2.1?: Nested values always cast to string

2016-06-27 Thread Barry Kaplan
I thought one of the big improvements in 2.x was not blindly casting nested values to strings: vars: a_var_number: 200 tasks: - mymodule: module_args: a_fixed_number: 100 a_var_number: "{{ a_number }}" a_var_number_with_cast: "{{ a_number | int }}" Inside the module

[ansible-project] set_fact with single item array gets flattened -- by design?

2016-06-27 Thread Barry Kaplan
(ansible 2.1) I have a set_fact like: - name: Get plant agent data from consul set_fact: myfact: "{{ lookup('consul_kv', 'mykey recurse=true') }}" When the lookup returns an array of size >= 2, 'myfact' is assigned the array value. But when the lookup returns an array of

[ansible-project] Re: ec2 host variables lost with refresh_inventory

2016-06-21 Thread Barry Kaplan
I am seeing similar behavior with 2.1. If I use refresh_inventory some of the hosts are removed and plays subsequently fail. -- 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,

[ansible-project] path not honored in requirements.yml for 2.1 ?

2016-06-20 Thread Barry Kaplan
Our requirements.yml had entries of the form: - src: ansiblebit.oracle-java path: vendor/roles/ name: oracle-java But how when running galaxy-install these roles are no longer installed in the specified ./vendor/roles directory, but rather into ./roles. Reading

[ansible-project] How to specify ANSIBLE_CONSUL_URL for consul_kv lookup?

2016-06-17 Thread Barry Kaplan
This plugin uses os.environ['ANSIBLE_CONSUL_URL'] to get the consul url, defaulting to http://localhost:8500 if not set. This works fine when run on the host node where consul is running. How would I set a dynamically environment set a host env when this lookup is running local? I have

[ansible-project] Re: AttributeError: 'NoneType' object has no attribute 'run'

2016-06-17 Thread Barry Kaplan
Ok, user error (as I expected). I had copied in a version of sequence.py into my locals plugins/lookup_plugins directory that fixed this bug https://github.com/ansible/ansible/issues/11422 waiting for it be merged into 1.9. But I forgot to delete after. Now with_sequence works with 2.1.x for

[ansible-project] Re: AttributeError: 'NoneType' object has no attribute 'run'

2016-06-17 Thread Barry Kaplan
The problem seems to be task_executor.py#195 for this bit self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self. _loader, templar=templar) The result of that expression is None -- You received this message because you are subscribed to the Google Groups "Ansible Project"

[ansible-project] Re: AttributeError: 'NoneType' object has no attribute 'run'

2016-06-17 Thread Barry Kaplan
This seems to be related to with_sequence. But it's hard to imagine something so basic not working. - debug: var=item with_sequence: start=1 end=2 Yields TASK [debug] *** task path:

[ansible-project] Re: AttributeError: 'NoneType' object has no attribute 'run'

2016-06-17 Thread Barry Kaplan
Same error with v2.1.1.0-0.1.rc1 -- 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 post to this group, send

[ansible-project] AttributeError: 'NoneType' object has no attribute 'run'

2016-06-17 Thread Barry Kaplan
ansible 2.1.0.0, python 2.7 I am getting this error when trying to create an ec2 instance. It does not matter if the instance already exists or not, so I assume its more of a parsing error. This task works correctly with 1.9. I don't really see how to debug this. Any ideas? This this task:

[ansible-project] Re: 2.1 upgrade gather_subset error

2016-06-03 Thread Barry Kaplan
Thanks Dragan! That did it. -- 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 post to this group, send email

[ansible-project] Re: 2.1 upgrade gather_subset error

2016-05-28 Thread Barry Kaplan
Well, that did not solve the problem. I had reverted back to 1.9, that's why it worked. So I'm still stuck. Can't get past this error when running 2.1. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Re: 2.1 upgrade gather_subset error

2016-05-28 Thread Barry Kaplan
I set in ansible.cfg gather_subset = all And the error is gone. Why would i /need/ to set a value for this? Is this now a required config option? What is used if not specified? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] 2.1 upgrade gather_subset error

2016-05-28 Thread Barry Kaplan
We are trying to upgrade from 1.9 to 2.1. With no changes to so far we get: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: gather_subset"} I cannot find any use of gather_subset in our playbooks or configuration. I also cannot find any notes on this

[ansible-project] What version of docker-py to use now with docker 1.7.1?

2015-08-07 Thread Barry Kaplan
Before 1.9.2 I had to pin docker-py to 1.1.0. Now for 1.9.2 to no error I have to pin docker-py to 1.2.3. But with 1.2.3 I get the following error: ConnectionError(ProtocolError('Connection aborted.', error(111, 'Connection refused')),) Does anybody have something working with 1.9.2 and

[ansible-project] Couldn't read packet: Connection reset by peer

2015-07-27 Thread Barry Kaplan
I am now getting these errors with a playbook that has been working for ages. I just recreated the ec2 instances -- so that is what is different -- but they were created using an existing ansible playbook. I can ssh into the instances. I have added 'scp_if_ssh=True' (base on other posts with

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-23 Thread Barry Kaplan
Perfect! I have removed the connection=local from the play and now all works as expected. I guess I don't fully understand why connection=local should be used. When I was first starting with ansible plays that I studied that did ec2 stuff used it, so I did too. -- You received this message

[ansible-project] Re: Modules Fix Missing in 1.9.2

2015-07-23 Thread Barry Kaplan
As Brian has cautioned, modules for v2 may not work with v1. But in this case, I have copied the v2 uri module into my project to gain the use of format_body and it has worked fine. -- You received this message because you are subscribed to the Google Groups Ansible Project group. To

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-19 Thread Barry Kaplan
All my hosts come from the ec2 inventory plugin. I can access the hosts in all other ways without having to explicitly specify an ansible_connection. So then is it better to specify the target host in the play and use local_action? I kinda thought these two were inverses of each other. -barry

[ansible-project] to_json uses single quotes

2015-07-17 Thread Barry Kaplan
I've seen one other post on this from 2014, but it did not really have solution. Whenever I use to_json the resulting json uses single quotes. Then when I later try to use from_json it does not parse. Is anybody else experiencing this? Any known workarounds? -- You received this message

[ansible-project] strange creating directory with delegate_to

2015-07-17 Thread Barry Kaplan
when running - debug: var=groups.control - name: Create facts.d directory on ops-control file: state: directory path: /etc/ansible/facts.d sudo: yes delegate_to: {{groups.control}} i get TASK: [debug var=groups.control]

[ansible-project] Re: strange jinja logic

2015-07-17 Thread Barry Kaplan
On Friday, July 17, 2015 at 5:07:32 PM UTC+5:30, Gerard Lynch wrote: There's a high likelihood that their type is actually 'string' instead of boolean, try Indeed. The values were == *'*True*'* not == True. Thanks! -- You received this message because you are subscribed to the Google

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-17 Thread Barry Kaplan
Brian, I'm not following you at all. It was the shell command that uses the delegate_to. The debug is only showing the register from the shell. - name: Test delegate to shell: echo {{ groups.consul_server[0] }} hostname -i register: __hostname delegate_to: {{

Re: [ansible-project] strange creating directory with delegate_to

2015-07-17 Thread Barry Kaplan
On Friday, July 17, 2015 at 6:49:56 PM UTC+5:30, Brian Coca wrote: delegate_to does not take lists, groups.control is a list, Ah, yes. Thanks! -- 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] to_json uses single quotes

2015-07-17 Thread Barry Kaplan
On Friday, July 17, 2015 at 7:02:51 PM UTC+5:30, Abhijit Menon-Sen wrote: Could you provide more details, please? It worked in the simple case I just tried: $ ansible localhost -m debug -a msg='{{ p|to_json }}' --extra-vars @p.yml localhost | success { msg: [{\foo\:

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-16 Thread Barry Kaplan
I see the same behavior with the moustaches: - name: Test delegate to shell: echo {{ groups.consul_server[0] }} hostname -i register: __hostname delegate_to: {{ groups.consul_server[0] }} - debug: var=__hostname TASK: [Test delegate to]

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-16 Thread Barry Kaplan
Hmm, thought I tried that, but will check. Thanks Brian. I wonder whether it would be better for it to be error if delegate_to does not resolve rather than silently fall back to localhost... Depending on the task fallback to localhost could do some serious damage. -- You received this message

Re: [ansible-project] Re: yaml structures passed to roles that to_json cannot use integers

2015-07-10 Thread Barry Kaplan
I have to say this is in my top 5 biggest ansible yak shavings. So many times I just need to pass configuration directly to a role which would to_json or to_yaml it. But I cannot because of this bug. Hence I need to parse out every little variable all the way down the structure ensuring that

[ansible-project] Re: jinja syntax error in lookup template says can't read file

2015-07-05 Thread Barry Kaplan
Seems the trick is to run the template thru the template action directly: template: src: ../files/prometheus/prometheus.yml.j2 dest: /tmp/p.yml Then you get a proper error message: TASK: [TEST TEST] * fatal:

[ansible-project] jinja syntax error in lookup template says can't read file

2015-07-05 Thread Barry Kaplan
I have template that contains - job_name: nodes consul_sd_configs: {% for cenv in prometheus_consul_dcs %} {% endfor %} This loads fine with prometheus_yml: {{lookup('template', '../files/prometheus/prometheus.yml.j2')}} But when I add a loop - job_name: nodes

[ansible-project] Should --tags work for playbooks?

2015-07-01 Thread Barry Kaplan
I have: --- - name: Dump data hosts: mesos_slave sudo: yes gather_facts: false tags: - mtc tasks: set_fact: dump_s3_bucket: product-data set_fact: dump_s3_folder: /dump But trying to use --tags yields: $ ansible-playbook -i inventory/aws/production

Re: [ansible-project] Possible bug in 1.9.2 ec2

2015-06-29 Thread Barry Kaplan
This remains in 1.9.2 -barry -- 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 post to this group, send email

Re: [ansible-project] Possible bug in 1.9.2 ec2

2015-06-29 Thread Barry Kaplan
And it doesn't matter if the instance already exists. Even when trying to create new instance the task is skipped. (Which makes sense -- a skip is a skip.) -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and

Re: [ansible-project] Possible bug in 1.9.2 ec2

2015-06-29 Thread Barry Kaplan
Looks like it a bug with count=1 - name: count=2 debug: var=item with_sequence: count=2 - name: count=1 debug: var=item with_sequence: count=1 TASK: [count=2] *** ok: [localhost] = (item=1) = {

[ansible-project] lookup_plugins config does not seem to work

2015-06-29 Thread Barry Kaplan
I have been using filter plugins with the ansible.cfg setting: filter_plugins = plugins/filter_plugins This is and has been working great. But now when I add: lookup_plugins = plugins/lookup_plugins No lookup plugins are not found. The best I can tell the lookup is by filename (unlike the

[ansible-project] Re: lookup_plugins config does not seem to work

2015-06-29 Thread Barry Kaplan
Sigh, user error. For reasons I will never know I named my plugin with the .yml extension instead of .py. But, on the upside, I got to find out just how incredibly well the the Intellij debugger works with python. For those interested: 1) Create a run configuration. In my case it was like:

[ansible-project] Re: Ansible 1.9.2 has been released

2015-06-28 Thread Barry Kaplan
I've been struggling with the python path since I've started with ansible some weeks ago (which is when I started with python). I've had to explicitly set PYTHONPATH, but I've never really understood if I should be doing so. I've just updated to ansible 1.9.2 (been using 1.9.2-rc2). But pretty

[ansible-project] Re: Ansible 1.9.2 has been released

2015-06-28 Thread Barry Kaplan
Hmm, well, a module that I have been using (copied in my ./modules) depends urllib but not does not import it. I added the import and my error is now gone. So it had nothing at all to do with python or ansible. No idea why this was working before. -- You received this message because you are

[ansible-project] Re: Ansible 1.9.2 has been released

2015-06-28 Thread Barry Kaplan
I see this issue which seems to be my problem, but no real info there: https://github.com/ansible/ansible/issues/11322 -- 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

Re: [ansible-project] confused about | mandatory

2015-06-28 Thread Barry Kaplan
os: ubuntu 14.04 ansible 1.9.2-rc2 (but maybe 1.9.2-rc1) python: 2.7.63 -- 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] Re: uri_module - json post

2015-06-26 Thread Barry Kaplan
I simply copied the 2.0 uir.py into my ./modules. It supports body_format=json which will convert the body dict into json as well as set the appropriate headers. Indeed I have done this for several modules that are scheduled for 2.0 or are pending PRs. Ansible is incredibly flexible in this

[ansible-project] Re: Inventory and group_vars layout advice

2015-06-26 Thread Barry Kaplan
I have, and and still are, struggling with this as well. Our inventory is very similar to yours. We have three AWS environments, and dozens of other on-prem environments. For the AWS we need to share a bunch of variables. Putting those in playbook group_vars does not work because the are only

[ansible-project] confused about | mandatory

2015-06-25 Thread Barry Kaplan
What is the scope to which |mandatory applies? It seems that debug is not one of them: vars: vi_tenant: {{ tenant | mandatory }} vi_plants: {{ plants | mandatory }} status: | Provisioning tenant security: env {{env}} tenant {{vi_tenant}}

[ansible-project] Cannot run 1.9.2 -- ERROR: apt is not a legal parameter in an Ansible task or handler

2015-06-23 Thread Barry Kaplan
When I try to use 1.9.2-rc2 ansible❯ source ~/si/ansible/hacking/env-setup ops/git/master !+ examine files in directory

[ansible-project] Re: Cannot run 1.9.2 -- ERROR: apt is not a legal parameter in an Ansible task or handler

2015-06-23 Thread Barry Kaplan
Ok, if you ever get these kinds of errors, the fix is easy. When you clone ansible don't forget the --recursive! -- 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

[ansible-project] Re: Cannot run 1.9.2 -- ERROR: apt is not a legal parameter in an Ansible task or handler

2015-06-23 Thread Barry Kaplan
Seems that (after making sure the submodules are pulled) that there is another problem I am seeing. After source ..hack.. my PYTHON path is setup as: /Users/bkaplan/si/ansible/lib: Hence the reason why modules like sys are not found. If I manually change it to:

[ansible-project] Re: yaml structures passed to roles that to_json cannot use integers

2015-06-21 Thread Barry Kaplan
I'm still hitting a wall on this. Any ideas anybody? -- 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 post to

[ansible-project] troubles with rabbitmq_user

2015-06-19 Thread Barry Kaplan
Whenever I set a user password with rabbitmq_user I cannot then log in. Using ANSIBLE_KEEP_REMOTE_FILES is see that the correct password is being sent. If I then reset the password using rabbitmqctl to the exact same value that rabbitmq_user used I can then log in. Is anybody else

[ansible-project] Re: troubles with rabbitmq_user

2015-06-19 Thread Barry Kaplan
RTFM: This was an existing user, hence: password: description: - Password of user to add. - *To change the password of an existing user, you must also specify* *C(force=yes).* required: false default: null -- You received this message because you are subscribed

[ansible-project] Re: troubles with rabbitmq_user

2015-06-19 Thread Barry Kaplan
But it's still unclear why the password is getting changed/corrupted without the force flag... -- 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] Re: How to execute pre tasks on all hosts before running tasks serial:1

2015-06-19 Thread Barry Kaplan
Just create two plays in the same playbook file. The first can run in parallel and the second in serial. -- 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

Re: [ansible-project] Re: Having troubles accessing hostvars for new host

2015-06-18 Thread Barry Kaplan
The flow is: provision.yml: -- - name: Provision rabbitmq cluster hosts: localhost connection: local gather_facts: yes tags: [provision, rabbitmq_cluster] tasks: - name: Create rabbitmq-server instance ec2: ... - include:

Re: [ansible-project] Re: Having troubles accessing hostvars for new host

2015-06-17 Thread Barry Kaplan
Yes, the play explicitly has gather_facts:true. The debug just above the failure clearly shows the attribute is present, that's what is confusing. On Thursday, June 18, 2015 at 9:38:08 AM UTC+5:30, Brian Coca wrote: did you gather facts after creating the instances? -- You received this

[ansible-project] Re: Having troubles accessing hostvars for new host

2015-06-17 Thread Barry Kaplan
Oh, I should have mentioned, this only happens when I have created the ec2 instances in the same play run. On a second run I don't ever seem to get this error. And this is on 1.9.2 -- You received this message because you are subscribed to the Google Groups Ansible Project group. To

[ansible-project] Having troubles accessing hostvars for new host

2015-06-17 Thread Barry Kaplan
I have some tasks like: - debug: var=hostvars[item] with_items: groups.rabbitmq_server - name: Update /etc/hosts with rabbitmq-server hostnames lineinfile: dest: /etc/hosts regexp: ^{{hostvars[item]['ansible_default_ipv4']['address']}}

[ansible-project] Re: Reviews needed for 99 new modules in Ansible Extras

2015-06-16 Thread Barry Kaplan
This is an impressive set of extensions. A question, when a modules has in its docs, eg requirements: [datadog] That implies the need for 'pip install datadog'? Not a requirement for a datadog role that includes the python library? -- You received this message because you are subscribed

[ansible-project] Re: this module requires key=value arguments ??

2015-06-15 Thread Barry Kaplan
Well I scp'ed my ansible checkout from my mac to my linux and all works now. So yes, it must be mismatches in the ansible branch and modules. But I have no idea how I got my mac into the state its in (ie, working) that is different from what I did with my linux box. I have been trying to run

[ansible-project] Re: this module requires key=value arguments ??

2015-06-15 Thread Barry Kaplan
Ok, I think this has to do with me trying to use 1.9.2-rc1. When I do a fresh checkout I get submodules that have lots more stuff than when after I run git submodule update --init --recursive After switching to the 1.9.2 tag. I'm clearly not understanding to keep the submodules in

Re: [ansible-project] Re: Role patterns

2015-06-13 Thread Barry Kaplan
On Saturday, June 13, 2015 at 11:53:32 PM UTC+5:30, Brian Coca wrote: I used to just make them templates, keep the file in native format and only template out the options that vary per my different classifications (stage, location, purpose). I have found (in my very short time with

Re: [ansible-project] Re: Role patterns

2015-06-13 Thread Barry Kaplan
On Saturday, June 13, 2015 at 3:11:17 PM UTC+5:30, José Riguera wrote: Yep, I think that is a good pattern as well. With your permission, when I have enough time I will add that example to the repo, or you can do it by yourself if you want :-) Either way is fine by me. -- You received

[ansible-project] Re: jinja woes

2015-06-13 Thread Barry Kaplan
So I ended up with {% for plugin in rabbitmq_plugins if plugin.state is not defined or plugin.state == 'enabled' -%} {{plugin.name}}{% if not loop.last %}{{','}}{% endif %} {% endfor %} Not terrible, but... -- You received this message because you are subscribed to the Google Groups

[ansible-project] jinja woes

2015-06-13 Thread Barry Kaplan
I really want better fp support for collections. With the following, where state defaults to enabled - role: rabbitmq rabbitmq_plugins: - name: rabbitmq_management - name: rabbitmq_autocluster_consul url: https: //github.com/aweber/.../rabbitmq_autocluster_consul-0.2.0.ez

[ansible-project] Re: Role patterns

2015-06-12 Thread Barry Kaplan
On the topic patterns, something I have been experiment with is to not try to define attributes for config files that are then substituted via a template by the role. Rather I have been using native configuration. It seems to me that there is little value trying to turn every type of config

[ansible-project] Re: Role patterns

2015-06-12 Thread Barry Kaplan
This is very nice. An excellent guide over the ansible docs. -- 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

[ansible-project] easy_install complains about 'state'

2015-06-10 Thread Barry Kaplan
Right out of the docs: - easy_install: name=pip state=latest Yields: TASK: [ansible | easy_install name=pip state=latest] ** failed: [10.0.192.110] = {failed: true} msg: unsupported parameter for module: state FATAL: all hosts have already failed -- aborting What

Re: [ansible-project] Re: What happend? Boto not found? sys is not defined?

2015-06-06 Thread Barry Kaplan
On Saturday, June 6, 2015 at 9:08:36 AM UTC+5:30, Brian Coca wrote: did you install ansible via homebrew? Hmm, I really don't remember. I could have been via pip. But I'm guessing that I did whatever the install the instructions said because when I first installed ansible (and started

[ansible-project] assemble delimiter does not resolve attributes

2015-06-06 Thread Barry Kaplan
I am using assemble like so: - name: Assemble the final kibana.yml assemble: src: {{kibana_confd_dir}} dest: {{kibana_config_dir}}/kibana.yml delimiter: # {{ansible_managed}} owner: {{kibana_user}} group: {{kibana_group}} mode: 0644 Which yields: TASK: [kibana |

[ansible-project] Re: assemble delimiter does not resolve attributes

2015-06-06 Thread Barry Kaplan
I guess this has nothing to with assemble, as this has the same problem copy: content: # {{ansible_managed}}\n\n dest: {{kibana_confd_dir}}/00-kibana-header.yml So there is something I do not understand about the scope of ansible_managed. -- You received this message because you

  1   2   >