[ansible-project] Re: Ansible Yum Update revision from given version

2017-02-01 Thread Jinesh Choksi
Hi Tiago, Although you have provided sufficient information, it was not a simple matter to try to reproduce the issue. :-) Here are some instructions for anyone wanting to try to reproduce this: I chose to use webmin as the package to test with since I had easy access to it. - Setup a

[ansible-project] Re: request for module rhn_register

2017-02-01 Thread Jinesh Choksi
There doesn't seem to be any way to pass additional options to the rhnreg_ks command that the rhn_register Ansible module builds up. The only two workarounds I can think off are: a) Amend

[ansible-project] Re: IOS_Config Question. New User

2017-02-01 Thread Jinesh Choksi
Hi There were a couple of small yaml syntax errors in your playbook. Here is what it should look like: --- - name: PLAY - BACKUP hosts: - localhost gather_facts: no connection: local tasks: - name: OBTAIN LOGIN CREDENTIALS include_vars: ./secrets.yml - name:

[ansible-project] Re: Difficulty including files with password variables in.

2017-02-01 Thread Jinesh Choksi
Hard to say with the information given. Can you add a debug task before the subversion one to confirm that the vault encrypted password is correctly decrypted: - debug: var=secrets.svn_pass If you see its vaule is still in the encrypted form then, confirm if you are running the playbook with

[ansible-project] Re: Using with_dict with a loop and missing key values...

2017-02-01 Thread Jinesh Choksi
Your dict has a key called "ssh_key" but the "when" clause in the task says: "- item.value.ssh_key*s*.exists == true" Notice the extra 's' in ssh_keys. Is that correct? On Tuesday, 31 January 2017 13:50:27 UTC, Raphael Rabelo de Oliveira wrote: > > Hi guys, > > I'm trying to use a loop and

[ansible-project] Re: Ansible best practice

2017-01-31 Thread Jinesh Choksi
Hi Rui, You can find a role for installing Prometheus here: https://github.com/kozmagabor/ansible-prometheus Which also has a complementary role to setup the mongodb exporter: https://github.com/William-Yeh/ansible-mongodb-exporter I found both of the above via Ansible Galaxy:

[ansible-project] Re: How to manage the crontab entries that were not done by Ansible's cron module

2017-01-27 Thread Jinesh Choksi
>My existing crontabs do not have this tag prefixed. Can I still update and delete them through Ansible cron module ? >From the documentation, it doesn't look likely since if you don't set a name parameter and if state=present then it will create a new crontab entry regardless of any existing

Re: [ansible-project] lineinfile problem

2017-01-27 Thread Jinesh Choksi
*File: example_file.txt* string1 string2 string3 string4 string5 string0 string7 string8 string9 *File: run.sh* #!/usr/bin/env bash ansible-playbook -vvv -i 'localhost,' -c local test.yml *File: test.yml* - hosts: - localhost tasks: - name: "Slurp the file we wish to search"

Re: [ansible-project] lineinfile problem

2017-01-26 Thread Jinesh Choksi
Hi Mark, I found the following https://relativkreativ.at/articles/how-to-use-ansibles-lineinfile-module-in-a-bulletproof-way very useful when I needed to find a reliable way to edit lines in a configuration file with Ansible tasks. See if it helps you understand how to use lineinfile in a

[ansible-project] Re: Testing for a defined but non empty string

2017-01-26 Thread Jinesh Choksi
On Thursday, 26 January 2017 07:50:39 UTC, Michael Shi wrote: > > Is there really no better way to do it? While Leo's method works it's > extremely ugly to look at nor easily reusable. > Would this help you? - name: do something shell: do task when: ansible_local[foo] is defined Instead

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-13 Thread Jinesh Choksi
Ack. I just noticed that the example below is not a good solution since it never did run the "Performing tasks after windows updates." task in the main.yml file. Sorry. Please ignore the example. On Friday, 13 January 2017 14:14:58 UTC, Jinesh Choksi wrote: > > - "un

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-13 Thread Jinesh Choksi
- "until: is not currently supported on includes." (https://github.com/ansible/ansible/issues/17098) - "When you call include, Ansible actually places tasks from included file into the execution queue after the current task." (http://stackoverflow.com/a/38481496) The example below is a hack

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-12 Thread Jinesh Choksi
Hi Danny, Did you come across this post - https://groups.google.com/d/msg/ansible-project/E1ETAVoG6d0/6vC0PGCpAwAJ ? > Right now looping over includes is doable by doing a *with_ *statement. What I trying to achieve right now would look like: > >- include: run-in-loop.yml > with_sequence:

[ansible-project] Re: Playbook can't connect to EC2 instance, but SSH works fine?

2016-10-27 Thread Jinesh Choksi
Hi 1. Ansible is failing to connect to: ec2-54-194-77-121.eu-west-1.compute.amazonaws.com 2. Your manual SSH test is against a different host: ec2-54-171-76-221.eu-west-1.compute.amazonaws.com 54.194.77.121 vs 54.171.76.221 Was this a typo? The "unreachable" part means Ansible couldn't make

Re: [ansible-project] Scoping of playbooks

2016-10-21 Thread Jinesh Choksi
If in your inventory file you were targeting all possible nodes which require configuring: Then in a playbook (run on each of those nodes): - You could use: set_fact (http://docs.ansible.com/ansible/set_fact_module.html) to register a fact containing the current node's gw. I think you can use

[ansible-project] Unable to find out information about Ansible releases via GitHub API

2016-10-20 Thread Jinesh Choksi
Hi I was interested in finding out what the latest available Ansible releases were via GitHub's API. The following curl command should have showed me all the available "published" releases of Ansible: curl -s "https://api.github.com/repos/ansible/ansible/releases; Specifically, GitHub's API