Re: [ansible-project] How to manage AWS resources by Ansible Without Access Keys and Secret Access Keys

2019-01-03 Thread Karl Auer
I have used the ec2 module a LOT on a build host with an instance policy and have never had to include those two items. I simply omit them. The module still works fine. So I think you CAN "just skip them"... as long as you have an appropriate instance policy. And (obviously) as long as Ansible is

[ansible-project] Re: Rebooting a Cisco ASA device

2019-01-03 Thread Ganesh Nalawade
Try adding "meta: reset_connection" after wait_for task and before check version task. Also, which Ansible version are you using? Regards, Ganesh On Friday, 4 January 2019 04:26:41 UTC+5:30, Sahar wrote: > > I'm trying to reboot a Cisco ASA Firewall, and run the "show version" > command after

[ansible-project] Re: rolling tasks for multiple clusters?

2019-01-03 Thread 'J Hawkesworth' via Ansible Project
I wound up having multiple playbooks and using something else to run them simultaneously. I've used gnu parallels in some cases and jenkins jobs in others. parallels is nice because you can kick off a lot of jobs simultaneously with a single command line. However its not great for viewing

[ansible-project] Re: Does Ansible support actions for NETCONF devices?

2019-01-03 Thread Ganesh Nalawade
Since action is a netconf RPC defined in RFC 7950 it can be executed using Ansible netconf_rpc module. - name: execute action rpc netconf_rpc: rpc: action xmlns: "urn:ietf:params:xml:ns:yang:1" content: | apache-1

[ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
SUMMARY jinja2 template issues with hostvars ISSUE TYPE - Bug Report COMPONENT NAME jinja2 template ANSIBLE VERSION ansible 2.7.2 config file = /home/feisa/ansible-linux/ansible.cfg configured module search path = [u'/home/feisa/ansible-linux/library'] ansible python module location =

Re: [ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
I figured out. I came with this: *- hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" * #THIS SCRIPT RANDOMS THE HOST become: true vars: - ansible_sudo_pass: *** roles: *- role: "{{ ['reboot','shutdown'] | random }}"* #THIS SCRIPT RANDOMS THE ROLE So I guess we can consider this

Re: [ansible-project] How to random roles

2019-01-03 Thread Francis Santos
I figured out. I came with this: *- hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" * #THIS SCRIPT RANDOMS THE HOST become: true vars: - ansible_sudo_pass: *** roles: *- role: "{{ ['reboot','shutdown'] | random }}"* #THIS SCRIPT RANDOMS THE ROLE So I guess we can consider this

[ansible-project] Re: Inventory scripts: How to add debug info when run via Ansible?

2019-01-03 Thread Francis Santos
Is this what you are looking for? tasks: - name: enabling consul service: name=consul enabled=yes state=started when: - service: name=consul state=stopped *register: results ### stores output on a variable* ignore_errors: yes - name: show results of disabling consul *

Re: [ansible-project] How to manage AWS resources by Ansible Without Access Keys and Secret Access Keys

2019-01-03 Thread S Saravanan
Thank you Karl and Dick. On Thursday, January 3, 2019 at 5:32:29 PM UTC+5:30, Karl Auer wrote: > > I have used the ec2 module a LOT on a build host with an instance policy > and have never had to include those two items. I simply omit them. The > module still works fine. > > So I think you

Re: [ansible-project] How to Random Roles

2019-01-03 Thread Karl Auer
Are you trying to randomly select a role, randomly select a host, then run the selected role on the selected host? On Fri, Jan 4, 2019 at 12:09 AM Francis Santos wrote: > I gotta random both the hosts and the roles. > I successfully randomed the hosts, but I not getting the roles to random. >

[ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
I gotta random both the hosts and the roles. I successfully randomed the hosts, but I not getting the roles to random. Here is what I got --- - hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" become: yes vars: - ansible_sudo_pass: ** * roles: * * - reboot || shutdown* Need a way

Re: [ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
No, the picture is that the role is not on the hosts. First I random a host (that script does that). Once a host is selected then the role is randomized. On Thursday, January 3, 2019 at 11:09:40 AM UTC-2, Francis Santos wrote: > > I gotta random both the hosts and the roles. > I successfully

Re: [ansible-project] Re: win_chocolatey does not update programs/features list on the windows target os

2019-01-03 Thread Serge Zajac
Hello, no problem is not really solved. But as you mentionned, sometimes, list is updated, i have to check this with my system admins team. The package is a custom package and params in the chocolateyinstall.ps1 are silentArgs= "/qn /norestart /l*v

[ansible-project] rolling tasks for multiple clusters?

2019-01-03 Thread Doug OLeary
Hi; I've read the docs on rolling updates and that sounds very close to what I'm looking for; however, I need to execute rolling reboots for multiple clusters preferably simultaneously. More specifically, after patching oracle clusters, i need to: 1. Execute a task to relocate oracle

[ansible-project] Ansible and Huawei

2019-01-03 Thread Anurag Bhatia
Hello there Was wondering if anyone has experience of using ansible with Huawei successfully? We are using Huawei at our IX and I am able to use ad-hoc commands with Huawei but playbooks based on documentation fail with a ncclient related error. We do have nc client as well as netconf installed

[ansible-project] win_pagefile is not returning configured pagefiles

2019-01-03 Thread Dave Olker
My Windows 2016 server has the following pagefile configuration: C:\Windows\system32>wmic pagefile list /format:list AllocatedBaseSize=9728 CurrentUsage=0 Description=D:\pagefile.sys InstallDate=20190103102344.598855-480 Name=D:\pagefile.sys PeakUsage=0 Status= TempPageFile=FALSE The below

[ansible-project] Rebooting a Cisco ASA device

2019-01-03 Thread Sahar
I'm trying to reboot a Cisco ASA Firewall, and run the "show version" command after it. It seems that rebooting works, but when the playbook gets to the show version command, it will get failed by showing the error down below. Any idea about it? - name: Rebooting the ASA asa_command:

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
Got to be something else. Are these linux hosts? I tried this and it works: playbook: --- - hosts: all   tasks:     - template:     src: template.j2     dest: /tmp/knownhosts template: {% for host in groups['all'] %} {{

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
They keys are there in facts > On Jan 3, 2019, at 4:06 PM, Hugo Gonzalez wrote: > > Got to be something else. Are these linux hosts? > > I tried this and it works: > > playbook: > > --- > - hosts: all > > tasks: > - template: > src: template.j2 > dest: /tmp/knownhosts

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
I just ran the same thing you ddi with the same issue I had. > On Jan 3, 2019, at 4:06 PM, Hugo Gonzalez wrote: > > Got to be something else. Are these linux hosts? > > I tried this and it works: > > playbook: > > --- > - hosts: all > > tasks: > - template: > src: template.j2

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
What version are you running? The linux host is centos7.6 Verified in my facts "ansible_ssh_host_key_ecdsa_public": "E2VjZHNhLXNoYTItbmlzdHAyNTYIbmlzdHAyNTYAAABBBGpMZqjhIzo6gGjz4eczxnatrAgmPxdWVYf0zY29MDngkKuOzjB0bMrR5sQm1X6leGgYowv3wNloWOZVbhwPU2A=", > On Jan 3, 2019, at 4:06 PM,

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Karl Auer
Your version has double quotes around the second line. The known working version does not. Could that be an issue? Regards, K. On Fri, Jan 4, 2019 at 10:20 AM Freddie Eisa wrote: > I just ran the same thing you ddi with the same issue I had. > > On Jan 3, 2019, at 4:06 PM, Hugo Gonzalez

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
I removed it with the same issue {% for host in groups['all'] %} {{ hostvars[host]['ansible_facts']['ssh_host_key_ecdsa_public'] }} {% endfor %} > On Jan 3, 2019, at 4:38 PM, Karl Auer wrote: > > Your version has double quotes around the second line. The known working > version does not.

Re: [ansible-project] Inventory scripts: How to add debug info when run via Ansible?

2019-01-03 Thread Hugo Gonzalez
Hi Jimmy, On 12/27/18 5:57 AM, Jimmy Htor wrote: Hey, The way I see it you either output to STDOUT, which would make debug output part of the inventory data, thus corrupt it. Or you output to STDERR and Ansible will treat is as actual errors (and show it using red color). Is there another

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
On 1/3/19 3:34 PM, Freddie Eisa wrote: So it depends on the host and how they are named and was really a test case. The one I’m really concerned about is this one now {% for host in groups['servers_production'] %} {{ hostvars[host]['ssh_host_key_ecdsa_public'] }} {% endfor %} I think you

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
I had tried but still receive fatal: [server]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ssh_host_key_ecdsa_public'"} > On Jan 3, 2019, at 3:23 PM, Hugo Gonzalez wrote: > > > > On 1/3/19 3:34 PM, Freddie Eisa wrote: >> So it depends on

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
This is what I’m running My role - name: Template Knownhosts template: src=./ssh_key.j2 dest=/tmp/temp.conf My template {% for host in groups['all'] %} "{{ hostvars[host]['ansible_facts']['ssh_host_key_ecdsa_public'] }}" {% endfor %} My playbook --- - name: Centos 7 Servers hosts:

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
Hello Freddie, On 1/3/19 12:04 PM, Freddie Eisa wrote: {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'eth0'"} How do you know what to look for in ansible_facts? Run the setup module against your managed hosts and see what the facts look like. I

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Freddie Eisa
So it depends on the host and how they are named and was really a test case. The one I’m really concerned about is this one now {% for host in groups['servers_production'] %} {{ hostvars[host]['ssh_host_key_ecdsa_public'] }} {% endfor %} > On Jan 3, 2019, at 2:31 PM, Hugo Gonzalez wrote:

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
On 1/3/19 4:26 PM, Freddie Eisa wrote: I had tried but still receive fatal: [server]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ssh_host_key_ecdsa_public'"} Please post the play you're using, or at least the relevant task and template.

[ansible-project] ansible role/playbook cloudwatch alarm

2019-01-03 Thread Frank Dias
I am looking for a role or play book that one could run against AWS EC2 instances and set a cloud watch alarm for "cpucreditbalance". frank -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving