[ansible-project] Re: Using ansible_winrm_server_cert_validation

2017-06-15 Thread 'J Hawkesworth' via Ansible Project
Yeah, I think that restriction is still in place, but group_vars is a good place for it. You have 'hosts: all' in your example playbook, but not all of them are going to be windows hosts (probably) so defining a group called windows and having these vars defined for hosts that belong to the

[ansible-project] Re: win_command not working ?

2017-06-15 Thread 'J Hawkesworth' via Ansible Project
Sure, the thing to understand is that win_command is for running executables directly. This means two things, 1/ the user's environment isn't applied and 2/ you aren't running inside a dos box or powershell window - you are just starting a .exe (and receiving back whatever it sends to stdout

Re: [ansible-project] Re: Can i use .yml file like this?

2017-06-15 Thread 강동인
Thank you ! Brian Coca ! 2017년 6월 16일 금요일 오전 12시 40분 58초 UTC+9, Brian Coca 님의 말: > > I believe this is what you want: > > - name: Cisco ios command > action: > module: "{{module}}" > host: "{{host}}" > username: "{{username}}" > password: "{{password}}" >

[ansible-project] Re: win_dsc using PolicyFileEditor DSC Module: failed to convert String to SINT32

2017-06-15 Thread Jordan Borean
Hey Thanks for the info you've posted, win_dsc has only been recently merged. Without knowing too much about how it works it seems like this is a bug with the module and it would be beneficial to raise an Issue at https://github.com/ansible/ansible. Thanks Jordan -- You received this

[ansible-project] Re: Roles list variable

2017-06-15 Thread Mouncif Benziane
Any solutions for this? I am trying to do the same but no luck! On Saturday, November 16, 2013 at 8:06:16 AM UTC-8, Marc Trudel wrote: > > Hi, > > For one of the playbook I am trying to write, I am trying to allow the > input of a dynamic role list. > > However, this does not seem to work: > >

[ansible-project] Re: WinRM error: ntlm: (u'http', u'Bad HTTP response returned from server. Code 500')

2017-06-15 Thread Jordan Borean
Hey Looks like you are trying to connect over port 5985 which is defaulting to http://hostname:5985/wsman instead of https://hostname:5986/wsman and Ansible by default doesn't allow you to talk through HTTP unless you have disabled some security restrictions on the Windows host itself. For a

Re: [ansible-project] Ansible check mode magic variable

2017-06-15 Thread Brian Coca
Have it pass --check .. its not a var, though it creates one for you to be able to use in conditionals, the reverse is not true. -- Brian Coca -- 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: Jinja 2 template syntax error

2017-06-15 Thread Owen Corcoran
Checked all hosts, and they all have eth0 interfaces. The loop in the template works when i limit it to one host group . I think its just not getting the vars the error is AnsibleUnderDefinedVariable: dict object has no attribute ansible_eth0 -- You received this message because you are

Re: [ansible-project] What determines the value of inventory_hostname

2017-06-15 Thread Brian Coca
so lets see if this explains it: hosts: reffers to groups/hostnames defined in your inventory, Ansible always provides a definition for 'localhost' just in case it is needed. `inventory_hostname` is 'the name you defined in inventory', the hostname of the machine will appear in gathered facts

Re: [ansible-project] Re: Jinja 2 template syntax error

2017-06-15 Thread Kai Stian Olstad
On 15. juni 2017 20:47, Owen Corcoran wrote: What the play book is running is {% for host_system in groups['hosts'] %} sentinel known-sentinel mymaster {{ hostvars[host_system]['ansible_eth0']['ipv4']['address'] }} 26379 {{ hostvars[host_system]['sentinel_id'] }} {% endfor %} The error im

Re: [ansible-project] get content from URL header

2017-06-15 Thread Christian Hügel
You´re a genius! Thank you Am Donnerstag, 15. Juni 2017 21:21:53 UTC+2 schrieb Kai Stian Olstad: > > On 15. juni 2017 20:45, Christian Hügel wrote: > > I need to get the content (md5 checksum) from the header of a url. This > > could be done with: > > > > - name: Get md5sum from

Re: [ansible-project] get content from URL header

2017-06-15 Thread Kai Stian Olstad
On 15. juni 2017 20:45, Christian Hügel wrote: I need to get the content (md5 checksum) from the header of a url. This could be done with: - name: Get md5sum from https://wordpress.org/latest.tar.gz header shell: curl --silent --head https://wordpress.org/latest.tar.gz | grep MD5 | awk

[ansible-project] Re: Jinja 2 template syntax error

2017-06-15 Thread Owen Corcoran
What the play book is running is {% for host_system in groups['hosts'] %} sentinel known-sentinel mymaster {{ hostvars[host_system]['ansible_eth0']['ipv4']['address'] }} 26379 {{ hostvars[host_system]['sentinel_id'] }} {% endfor %} The error im getting implied the host_system variable isnt

[ansible-project] get content from URL header

2017-06-15 Thread Christian Hügel
Hi, I need to get the content (md5 checksum) from the header of a url. This could be done with: - name: Get md5sum from https://wordpress.org/latest.tar.gz header shell: curl --silent --head https://wordpress.org/latest.tar.gz | grep MD5 | awk '{print$2}' register: md5sum_wordpress -

Re: [ansible-project] Can I use a pull-based model for the nodes?

2017-06-15 Thread Kai Stian Olstad
On 15. juni 2017 15:32, Sagi Smolarski wrote: Hi, I have a multi-tiered system where the end-stations are consumer devices (something like roomba), running ubuntu, in consumers' home (with access to the next via wifi). I would like to use ansible to implement auto-update, but the end-stations

[ansible-project] Did I take this concept too far or is this a bug?

2017-06-15 Thread Ed Balduf
I have a large playbook, which creates groups of VMs in a cloud and each VM needs some number of data volumes attached. I attempted to make it as modular as possible and started using roles and include_roles in loops. To do this, I have a role which loops over an include_role for the VMs and

Re: [ansible-project] LVM thin pool/poolmetadata

2017-06-15 Thread Kai Stian Olstad
On 11. juni 2017 17:49, Jeeva Chelladhurai wrote: $ sudo lvconvert -y \ --zero n \ -c 512K \ --thinpool docker/thinpool \ --poolmetadata docker/thinpoolmeta Unfortunately I couldn't find any module which would help me to do the lvconvert. Please guide me on this. You can always use the

Re: [ansible-project] Jinja 2 template syntax error

2017-06-15 Thread jean-yves
Hi, 15 juin 2017 19:13 "Owen Corcoran" a écrit: Looks like I pastes the wrong error. The error is undefined variable ansible_eth0. It's works when I only use one group rather than the combined group. Plus it doesn't seem to see the host var properties for the hosts On 15 Jun 2017 18:01,

[ansible-project] Can I use a pull-based model for the nodes?

2017-06-15 Thread Sagi Smolarski
Hi, I have a multi-tiered system where the end-stations are consumer devices (something like roomba), running ubuntu, in consumers' home (with access to the next via wifi). I would like to use ansible to implement auto-update, but the end-stations don't have a static IP and are not always

[ansible-project] Re: Using with_subelements, cannot reference dict item's key (v 2.2.0)

2017-06-15 Thread Hugo Slabbert
This would be a super helfpul feature to have, even if it's another lookup separate from with_subelements. The use case I have for this is a set of interfaces on a host that are in a dict with the keys being the interface names, e.g.: --- interfaces: lo0: addresses: - address:

[ansible-project] Re: ec2 inventory script broke with 'module' object has no attribute 'boto3_inventory_conn'

2017-06-15 Thread Vivek
It seems working fine with ansible 2.4.0 On Monday, June 5, 2017 at 9:02:17 PM UTC-4, Michael Bushey wrote: > > > /etc/ansible/ec2.py --list works, but if I try to run from ansible I get > this: > > ~/ansible/playbooks$ ansible -i /etc/ansible/ec2.py -u ubuntu us-east-1d > -m ping > Traceback

Re: [ansible-project] Ansible 2.1.0: "Interactive authentication required." when operating with sudo ?

2017-06-15 Thread Kavita Goel
Deepak, its already been a year. But I ran into this issue. Adding the following lines resoved: FAILED: - name: PostgreSQL service stop service: name: postgresql-9.5 state: stopped RESOLVED: - name: PostgreSQL service stop sudo: yes

[ansible-project] WinRM error: ntlm: (u'http', u'Bad HTTP response returned from server. Code 500')

2017-06-15 Thread Onallion
Hey guys, I currently have four Windows Server 2012 servers I want to manage via Ansible. On the first one, I turned off the Windows Firewall, added Ansible user as local admin, and ran the Powershell script. I can win_ping to that one successfully and it all works fine. For the other three, I

[ansible-project] ansible assign variable from json array

2017-06-15 Thread omar sheriff
my playbook and json file { "Tomcat": { "Instance": [ { "name": "devops", "uid": "jbosscfg", "gid": "staff", "dept":

[ansible-project] Using ansible_winrm_server_cert_validation

2017-06-15 Thread 'b-long' via Ansible Project
Hi All, As I noted in a previously closed issue , it's not clear to me where `ansible_winrm_server_cert_validation` will be respected in group_vars and host_vars. In addition, I'm unsure how to deal with the situation of

[ansible-project] win_dsc using PolicyFileEditor DSC Module: failed to convert String to SINT32

2017-06-15 Thread Ricardo Gaspar
Hi all, I was using the cAdministrativeTemplateSetting DSC Resource part of PolicyFileEditor module ( https://github.com/dlwyatt/PolicyFileEditor) in a DSC script and it works fine. Here are the resource's properties: cAdministrativeTemplateSetting [String] #ResourceName { KeyValueName =

[ansible-project] Install Jenkins server inside Vagrant box using ansible

2017-06-15 Thread minnickma
How would I go about installing a jenkins server inside of a vagrant box using ansible? I have found ways to install jenkins on the host machine using ansible but cannot find much documentation to get it running inside the box. Any help is much appreciated! -- You received this message

[ansible-project] spot instance block duration not working in ansible

2017-06-15 Thread Nilesh Devare
Hi unable to create aws spot instance with new feature spot block duration we tried to use wait: true but its not working any help please find below yml - hosts: localhost connection: local gather_facts: false tasks: - name: launch spot instance ec2: spot_price: 0.052

[ansible-project] Ansible Module to lookup variables of a given role

2017-06-15 Thread Hagen Kuehn
I would like to create an Ansible Module that can be used to lookup variables of a given role. Background: Our build Git repository is organized in away that we have one Ansible role per micro service (built repo). Those roles have the "default/main.yml", through which we define a number of

[ansible-project] Ansible 2.2 not respecting ssh.cfg

2017-06-15 Thread barrett
I am using a dynamic inventory. The build inventory returns hosts vars with the following inventory_hostname= jenkins-0.build.vnet ansible_host=y.y.y.y (There are private ips) I also have x.x.x.x = The public ip of the jump box I have the following in my ssh.cfg which is referenced in my

[ansible-project] unable to set spot block duration using wait: true and wait_time in ansible

2017-06-15 Thread Nilesh Devare
unable to set spot block duration using wait: true and wait_time in ansible - hosts: localhost connection: local gather_facts: false tasks: - name: launch spot instance ec2: spot_price: 0.052 region: us-east-1 keypair: test group_id: sg-5789654

[ansible-project] Re: Query on connecting remote windows servers from powershell server via ansible.

2017-06-15 Thread Rajat Bhasin
On Tuesday, November 29, 2016 at 5:36:46 AM UTC+5:30, Rajesh N wrote: > > Dear All, > I have an query/issue. > From my windows powershell server i am able to execute powershell scripts > on remote windows machines on same domain without asking for password using > the domain account. >

[ansible-project] EFS module - subnet does not exist (nondefault VPC)

2017-06-15 Thread Will Button
ansible - v2.3.0 boto3 - v1.4.4 I'm trying to create an EFS share in a non-default VPC in AWS. - name: Create EFS share efs: state: present name: "my_happy_efs_share" tags: name: "my_happy_efs_share" targets: - subnet_id:

[ansible-project] Ansible check mode magic variable

2017-06-15 Thread Maggie Pease
Hi, When running in with the --check mode flag, Ansible sets a magic variable ansible_check_mode to true. Should it be possible to also set it to true using an extra var like: ansible-playbook -i inventories/Dev playbook.yml -e 'ansible_check_mode=true' ? I tried setting it with the extra

[ansible-project] Re: asa_config issue

2017-06-15 Thread Bobby Roberts
Were you ever able to get this solved? Having the exact same issue as you. On Monday, June 5, 2017 at 6:37:36 PM UTC-4, Michael Lee wrote: > > Hi, There: > > I have problem to run ansible-playbook for Cisco ASA, and I manage sent > user directly to enable mode > by enable following command

[ansible-project] Running Certain commands via activates hardware watchdog

2017-06-15 Thread Satyam Mishra
Hi, I am installing infinidb database on my machine. I have used shell module to run certain commands: Part of playbook: - - - name: Uncompress and move to Calpont folder shell: | tar -xvf infinidb-dist-4.6.tgz cp -r

[ansible-project] win_command not working ?

2017-06-15 Thread Wenceslas des Deserts
t.Hi, I'm currently trying to use the win_command module of Ansible. Task (in a role, itself included in a playbook) looks like that : - name: Test module win_command: dir That's quite simple, really. Connection to the target works perfectly fine since I've been able to install features,

[ansible-project] What determines the value of inventory_hostname

2017-06-15 Thread Richard Stanfield
I'm very new to Ansible and I have inherited some Ansible playbooks that aren't working that I need to get working. I've been searching for quite some time and haven't found any answers for this. My current problem is that inventory_hostname is being set to localhost and I need confirmation on

[ansible-project] Ansible module to lookup variable from given role

2017-06-15 Thread Hagen Kuehn
I would like to create an Ansible Module that can be used to lookup variables of a given role. Background: Our build Git repository is organized in away that we have one Ansible role per micro service (built repo). Those roles have the "default/main.yml", through which we define a number of

[ansible-project] Ansible and BMC Remedy

2017-06-15 Thread Timothy Mobley
I use BMC Remedy for ITSM, but would like to see about the possibility of integrating Ansible in Remedy to automate configuration. I had read this article which mentioned this

[ansible-project] Getting an error message: ' Unable to open shell, rc:255'

2017-06-15 Thread Harsheen Khandpur
Hi , I am getting this error message and the logs are not showing anything different. I have used the ping and shell module separately to test the connection and it works. Please suggest a solution. -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] template expands on OSX but not on Linux

2017-06-15 Thread Brian Fallik
Hi, I'm trying to build a playbook using set_fact but the template seems to expand when I test locally on OSX but not when I invoke ansible via Jenkins on Linux. Here's the line: - set_fact: snapshot_id: "production-snapshot-{{ 20 | random | to_uuid | replace('-', '') |

Re: [ansible-project] Jinja 2 template syntax error

2017-06-15 Thread Owen Corcoran
Looks like I pastes the wrong error. The error is undefined variable ansible_eth0. It's works when I only use one group rather than the combined group. Plus it doesn't seem to see the host var properties for the hosts On 15 Jun 2017 18:01, "Dick Davies" wrote: What does

Re: [ansible-project] Jinja 2 template syntax error

2017-06-15 Thread Dick Davies
What does the generated config look like? The error is just redis-sentinel crashing. On 15 June 2017 at 17:47, Owen Corcoran wrote: > > Hi, > > > > Im having an issue with the following Jinja2 template and I just cant figure > out how to get it to display the ip4 addresses

[ansible-project] Re: Prevent notify from restarting service if something else will

2017-06-15 Thread Gilberto Valentin
With the help of members of the IRC #ansible channel, I was able to solve my logic. What I ended up doing was removing the following task: - name: Enable and start app systemd: name: guest enabled: yes state: started daemon_reload: yes Then, I modified the handler for *nofity:

[ansible-project] Jinja 2 template syntax error

2017-06-15 Thread Owen Corcoran
Hi, Im having an issue with the following Jinja2 template and I just cant figure out how to get it to display the ip4 addresses of the hosts from the hostvars for the hosts in the inventory file below {% for host_system in groups['hosts'] %} {% if "ansible_eth0" in

[ansible-project] Re: Send SMS using Twilio in ansible , getting below error

2017-06-15 Thread 'J Hawkesworth' via Ansible Project
Looks like you either need to use a more recent version of python. Perhaps you can delegate the module to run on a newer linux distribution if you can't upgrade your ansible controller machine. On Wednesday, June 14, 2017 at 11:11:07 AM UTC+1, nishant bawane wrote: > > i have tried using the

Re: [ansible-project] Re: Can i use .yml file like this?

2017-06-15 Thread Brian Coca
I believe this is what you want: - name: Cisco ios command action: module: "{{module}}" host: "{{host}}" username: "{{username}}" password: "{{password}}" commands: "{{commands}}" -- Brian Coca -- You received this message because you are subscribed

[ansible-project] Re: Can i use .yml file like this?

2017-06-15 Thread 'J Hawkesworth' via Ansible Project
You could perhaps use template to generate the playbook file that you want to use, then run the generated playbook. I don't know what alternative value for module might be, but you could perhaps use when: condition to only run ios_command if some condition is true. Something like this (not

Re: [ansible-project] Book recommendations?

2017-06-15 Thread leam hall
Andrew, that one came in the mail late last night and I'm in chapter 2 now. Great stuff, thanks! Leam On Monday, June 12, 2017 at 9:26:12 AM UTC-4, Andrew Latham wrote: > > Paper books will become out of date quickly but try > https://www.ansiblefordevops.com/ > > > On Fri, Jun 9, 2017 at