[ansible-project] Re: Using ec2_vol with dynamic inventory

2016-07-21 Thread Max Leon
Hi Joanna, Thanks for your post, I just tried your suggestion but still isn't working. But you pointed me in the right direction. I was running ec2_facts as a local action which was incorrect and using a tripple debug flag I noticed that aws_access_key and aws_secret_key were null, seems

[ansible-project] curl playbook

2016-07-21 Thread GBANE FETIGUE
Hi guys, I am running an ansible playbook that supposed to return an apllication ID that I am having some issue; here the playbook - action: shell curl --basic -u admin:admin -F file=/etc/ansible/playbooks/ms3-samples.zip -F name=ms3-samples -F version=2.0 --header

[ansible-project] launching VM in openstack throws shade error

2016-07-21 Thread Shabari Nath
i have tried launching a VM in openstack env with os_server module. When i execute the playbook it throws following error: fatal: [vsilmasv24-vzbi-com]: FAILED! => {"changed": false, "failed": true, "msg": "shade is required for this module"} Please help me. my playbook: --- - hosts:

[ansible-project] Re: Ansible 2.0 -- "shade is required for this module"

2016-07-21 Thread zerros
Hi, forgive me for my bad english. I have exactly the same problem with ansible 2.2 and python 2.7. All packages are installed in system, no venv but ansible continue with fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "shade is required for this module"} I know this

[ansible-project] Re: Could a value refer another key’s value as variable

2016-07-21 Thread Joanna Delaporte
Does field2's value display correctly if you use the full path to the other variable? --- - hosts: localhost vars: record: field1: 1 field2: "{{*record.*field1}}" tasks: - name: This one does not work debug: msg="{{record.field2}}" On Wednesday, July 20, 2016 at

[ansible-project] Re: Using ec2_vol with dynamic inventory

2016-07-21 Thread Joanna Delaporte
Hi Max, Are you running this playbook with the ec2 instance as the remote target? You are missing the reference to the registered fact, I think: - name: gather ec2 facts action: ec2_facts register: ec2_facts - debug: var=ec2_facts - name: Add volume for cassandra nodes

[ansible-project] Re: lineinfile tasks adds line when exists

2016-07-21 Thread Joanna Delaporte
Hi Robert, To replace an existing line, you will want to use backrefs. Otherwise, I believe the default behavior is to insert the line after EOF or the last match of a specified regexp. Insertafter and backrefs are exclusive of each other, since the line will be added after, or replace an

[ansible-project] Re: Using win_regedit to harden Windows server ciphers

2016-07-21 Thread Matt Davis
+1 to this- IISCrypto is a great tool to make this easier, and bonus: it's available from chocolatey, thus easy to deal with from Ansible... On Monday, July 18, 2016 at 1:07:18 AM UTC-7, Mike Fennemore wrote: > > I'm assuming for the security hardening you would be disabling multiple > ciphers

Re: [ansible-project] lineinfile tasks adds line when exists

2016-07-21 Thread Kai Stian Olstad
On 21. juli 2016 20:30, Robert Margeson wrote: I wrote a playbook to make a config edit in /etc/postgreql/95/main/pg_hba.conf. Basically, it's to search for an existing string and replace it. Trouble is, when the playbook is ran for a second time, it adds the line as if it didn't exist.

Re: [ansible-project] NTLM Delegation

2016-07-21 Thread Matt Davis
I don't believe NTLM credential delegation is supported by WinRM (I've not been able to find anything about it), which means by definition it wouldn't be supported by Ansible either. That said, I've been experimenting with various mechanisms for become support on Windows (soft target for

[ansible-project] Re: Creating ansible modules for windows

2016-07-21 Thread Matt Davis
You can also place them in a directory named library/ next to your playbooks- this is usually the way I tell people to do it, so your modules can be versioned alongside your content. The .py doc file is not required anymore (it was at one point), but strongly encouraged so that ansible-doc

[ansible-project] lineinfile tasks adds line when exists

2016-07-21 Thread Robert Margeson
I wrote a playbook to make a config edit in /etc/postgreql/95/main/pg_hba.conf. Basically, it's to search for an existing string and replace it. Trouble is, when the playbook is ran for a second time, it adds the line as if it didn't exist. Thoughts? - name: postgres | Allow MD5

Re: [ansible-project] host_vars/all does not work anymore?

2016-07-21 Thread Kai Stian Olstad
On 21. juli 2016 18:40, Do Hoang Khiem wrote: So from what I see, host_vars/all does not work even if it's located at same directory as playbook or same directory as inventory. From Ansible: http://docs.ansible.com/ansible/intro_inventory.html *Tip: In Ansible 1.2 or later the group_vars/

[ansible-project] Using ec2_vol with dynamic inventory

2016-07-21 Thread Max León
Hi, I'm trying to create a playbook that will attach a volume to the specified instances and install casssandra as a cluster. I have almost everything worked out but the ec2_vol part. # tasks file for cassandra - name: gather ec2 facts action: ec2_facts register: ec2_facts

[ansible-project] host_vars/all does not work anymore?

2016-07-21 Thread Do Hoang Khiem
My simple test case: *ubuntu@ansible-tower-server:~/temp/ansible$ ansible --version* ansible 1.9.4 configured module search path = None *ubuntu@ansible-tower-server:~/temp/ansible$ tree .* *.* ├── *env* │ └── *staging* │ └── *th* │ ├── hosts │ └──

[ansible-project] Re: What I supposed to do with a long time no response Ansible playbook process?

2016-07-21 Thread rup
To find current process, run this to get PID to kill: ps -ef|grep ansible A command I use to watch Ansible processes as they are running is: watch -n 3 'netstat -ta | egrep ":ssh +EST"' So I can follow along with what's being run. Kim -- You received this message because you are

[ansible-project] Re: Creating ansible modules for windows

2016-07-21 Thread 'J Hawkesworth' via Ansible Project
You should just be able to put your custom modules in your /etc/ansible/library folder and they will become available to your playbooks. I think you have to have a module_name.ps1 and a module_name.py in /etc/ansible/library (the .py file is just used for documentation, but I think ansible

Re: [ansible-project] Running ansible playbooks in Bamboo?

2016-07-21 Thread Stephen Granger
>From memory, the bamboo boot process doesn't allow any boot strapping for running user data scripts, it hides/locks that away. https://confluence.atlassian.com/bamboo/configuring-elastic-bamboo-289277120.html As has been suggested, run a prior job to set up the users details, or follow your

Re: [ansible-project] modules apt: only_upgrade fail

2016-07-21 Thread Kai Stian Olstad
On 21. juli 2016 03:44, richard934...@gmail.com wrote: xx.xxx.xx.xxx | FAILED! => { "changed": false, "failed": true, "msg": "Boolean docker-engine not in either boolean list" } ``` In the document only_upgrade(added in 2.1) Only install/upgrade a package if it is already

Re: [ansible-project] Re: Ansible Acton Plugins

2016-07-21 Thread Vyacheslav Voronenko
in my case actions plugins are not picked up from action_plugins/ folder, but lookup one do from lookup_plugins/ folder. Perhaps I missing smth obvious. i.e. I have set of lookup plugins: /deployment/boxes/lookup_plugins ➜ lookup_plugins git:(feature-standalone-gl-ee) ls *.py

[ansible-project] Re: Ansible Acton Plugins

2016-07-21 Thread Mike Biancaniello
Vyacheslav, I'm not sure I understand your question? On Thursday, July 21, 2016 at 9:07:49 AM UTC-4, Vyacheslav wrote: > > Mike, > > I think, I have similar issue. > > Mine local lookup plugins from playbook_dir/lookup_plugins are loaded and > executed fine, but the same manner implemented

[ansible-project] using Module apt: only_upgrade is wrong

2016-07-21 Thread richard934935
Hello, Having either apt: only_upgrade=docker-engine in my playbook or running it on the command line as ansible all --sudo -m apt -a 'only_upgrade=docker-engine' fails with ``` xx.xxx.xx.xxx | FAILED! => { "changed": false, "failed": true, "msg": "Boolean docker-engine not in

[ansible-project] is this thing working?

2016-07-21 Thread Ian Dennison
No updates on several browsers for 3 hours now. Did someone fall asleep? -- 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] Dynamic inventory with OpenStack

2016-07-21 Thread sergio gonzalez
Hello I am trying to use the dynamic inventory script: $ ./openstack.py --host 10.2.1.111 Traceback (most recent call last): File "./openstack.py", line 246, in main() File "./openstack.py", line 232, in main inventory = shade.inventory.OpenStackInventory(**inventory_args)

[ansible-project] Format for conditional password change

2016-07-21 Thread Ian Dennison
Am creating a playbook where the password age is set to 0 on userid create. The variable "user_created" gets detected as "changed" when a deleted userid is already deleted (ie, has "absent" in the item.state), so I am trying to work around this by putting a double conditional in the "users set

[ansible-project] Re: Running ansible playbooks in Bamboo?

2016-07-21 Thread Vyacheslav
If you have credentials to the host, you might create parametrized bamboo job like "bootstrap.box" , which will execute small playbook to configure new box for bamboo (like add keys, perhaps create some user and so on) On Wednesday, 20 July 2016 17:53:31 UTC+3, ZillaYT wrote: > > I saw this

[ansible-project] when Host Unreachable, execute a command or a script only for the failed host

2016-07-21 Thread Sudarsan Mukundhan
Hi, I have a group of hosts (say 3 hosts) of which one becomes unresponsive (due to heavy load or sshd is not running etc reasons). So eventually Ansible Playbook would fail with unreachable host message for that host. I want to handle this error and run a script locally (where the playbook

[ansible-project] Re: Ansible Acton Plugins

2016-07-21 Thread Vyacheslav
Mike, I think, I have similar issue. Mine local lookup plugins from playbook_dir/lookup_plugins are loaded and executed fine, but the same manner implemented action plugins are not loaded from file like playbook_dir/action_plugins/action.py Is there additional magic linked to library too ?

[ansible-project] GCP authentication with .json file

2016-07-21 Thread sekov
Hello everyone I have a question. I have machine in Google Cloud Engine . I have filed out the security.py както and gce.ini .The ./gce.py --list gives me all the machines from the project ,but the GCE_INI_PATH=~/.gce.ini ansible all -i gce.py -m setup is telling me that I can not do an ssh

[ansible-project] modules apt: only_upgrade fail

2016-07-21 Thread richard934935
Hello, Having either apt: only_upgrade=docker-engine in my playbook or running it on the command line as ansible all --sudo -m apt -a 'only_upgrade=docker-engine' fails with ``` xx.xxx.xx.xxx | FAILED! => { "changed": false, "failed": true, "msg": "Boolean docker-engine not in

Re: [ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread Kai Stian Olstad
On 21.07.2016 10:11, Kai Stian Olstad wrote: On 21.07.2016 09:32, ishan jain wrote: - I do not have extensive knowledhe of jinja2 templates and seems like i will have to learn a few things to create a report template It will be rewarding in the end, you can do a lot of things with jinja2

Re: [ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread Kai Stian Olstad
On 21.07.2016 09:32, ishan jain wrote: On Thursday, 21 July 2016 12:44:07 UTC+5:30, Kai Stian Olstad wrote: On 21.07.2016 08:28, ishan jain wrote: > So, does anyone has an idea how i can generate a report in the end > after > collecting output of multiple commands ? Template?

[ansible-project] Re: azure_rm_virtualmachine and ssh_public_key dict

2016-07-21 Thread Merv Merv
Hi Praneeth, Is it working when you provide the subnet name too? Thanks. Merv On Wednesday, July 20, 2016 at 8:23:23 PM UTC+5:30, Praneeth Reddy Putha wrote: > > Hi Steven, > > Please use in below format. > > - name: Create the Host VM > azure_rm_virtualmachine: > state:

Re: [ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread Kai
Hi! If you can figure out, how to create your report on the target machine, then you're nearly done. :) Just do that and thereafter transfer it to the control machine (I don't have a link at hand, but that's possible). Cheers, Kai On 21 July 2016 09:32:35 CEST, ishan jain

Re: [ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread ishan jain
I can see a few problems with the templates: - I want the report on Ansible host machine and not on target machines - Seems like a difficult job to consolidate report within template for each target host. For eg this kind of report: Check number 1 [host 1]: OK [host 2]: Failed - I do not

Re: [ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread Kai Stian Olstad
On 21.07.2016 08:28, ishan jain wrote: So, does anyone has an idea how i can generate a report in the end after collecting output of multiple commands ? Template? https://docs.ansible.com/ansible/template_module.html -- Kai Stian Olstad -- You received this message because you are

Re: [ansible-project] become method - pbrun and su

2016-07-21 Thread Kai Stian Olstad
On 20.07.2016 22:23, Veda K wrote: Is there any other way that I can use pbrun su ? Did anyone come across this scenario ? This has been asked and answered many times, search and you'll find https://groups.google.com/forum/#!searchin/ansible-project/sudo$20su

[ansible-project] iptables module with port forwarding

2016-07-21 Thread Chun-Hung Huang
Hi ALL I want to use iptables module to manage port forwarding > EXT_IP:EXT_PORT > INT_IP:INT:PORT If user request EXT_IP with port 8001, it will forward to INT_IP ( 192.168.100.131 ) and port 22. I use iptables module but fail *#* ansible -m iptables -a 'table=nat

[ansible-project] Has anyone used Ansible to generate a kind of report about certain checks on remote hosts ?

2016-07-21 Thread ishan jain
Hi All, I am trying to prepare Ansible scripts to check remote hosts for certain things like - OS version, free disk space etc. I am able to create tasks for each of this check as Ansible already have a great support for that, but i am stuck at a place on how to create a final report kind of