Re: [ansible-project] need help with nested loop

2019-06-05 Thread 'J Hawkesworth' via Ansible Project
Yeah with_together would work in your scenario. Strangely I was looking to do something similar but the very helpful F5 team provided me with this, so I thought I'd share it. I was trying to find a way to switch the pool members between 2 sets of servers. One difference here is we're associati

Re: [ansible-project] Help using yum-repository

2019-06-05 Thread Jonathan Lozada De La Matta
is the baseurl. You don't point to the .repo file but, the directory that has the repo files. Jonathan Lozada De La Matta on mobile From: ansible-project@googlegroups.com on behalf of Paul Evans Sent: Wednesday, June 5, 2019 7:05 PM To: Ansible Project Subject:

[ansible-project] Help using yum-repository

2019-06-05 Thread Paul Evans
Trying to install docker-ce. Manually, the commands to do this are: *yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo* Then *yum install docker-ce -y* works just fine. To replicate this in a playbook I am using *- name: Set up Docker-ce* * yum_reposit

Re: [ansible-project] Ansible vmware_vm_facts: get mac address for a specific VM and write it to existing inventory

2019-06-05 Thread Marco Reale
Hi guys Is there someone that coul help on this? Il mer 22 mag 2019, 10:55 PM Marco Reale ha scritto: > I have to goals with my plabook: > > > a) get mac address from a specific VM running on vsphere > > b) add it to my inventory file > > > My test environment is: > -Vsphere 6.5 > -Ansible 2.7

[ansible-project] Re: When condition and fetching values

2019-06-05 Thread Tanisha Mishra
Please dont suggest 'lookup' and default ansible modules. On Thursday, June 6, 2019 at 1:58:52 AM UTC+5:30, Tanisha Mishra wrote: > > I am using csv python module for importing a csv file > The csv is importing but unable to fetch the values properly. > My main aim is the prompt that takes as ser

[ansible-project] When condition and fetching values

2019-06-05 Thread Tanisha Mishra
I am using csv python module for importing a csv file The csv is importing but unable to fetch the values properly. My main aim is the prompt that takes as server name needs to check from the csv list whether it exists or not... I have to add 'when' condition also, but unable to separate HOST_NAME

[ansible-project] Re: azure_rm_virtualmachine module causing error to start or stop VM

2019-06-05 Thread Robert Williams
What version of Ansible and Python are you running? I have seen odd errors like your KeyError: 'diskSizeGB' with the azure_rm_devtestlabvirtualmachine - seems almost like it isnt properly determining what fields are required and whats not. I was seeing things like the virtual network being a r

Re: [ansible-project] How to make the package module useful again?

2019-06-05 Thread Matt Martz
To avoid duplicating my answer, and just for completeness. Please see my response here: https://github.com/ansible/ansible/issues/57189#issuecomment-499165098 On Wed, Jun 5, 2019 at 11:01 AM Orion Poplawski wrote: > We manage both Ubuntu and RedHat/Fedora systems from the same playbooks. > One

[ansible-project] How to make the package module useful again?

2019-06-05 Thread Orion Poplawski
We manage both Ubuntu and RedHat/Fedora systems from the same playbooks. One of the tools that has been very helpful for us in this is the generic "package" module. However, with the recent change to the yum lock timeout behavior with ansible 2.8, we are now required to set a long "lock_timeou

[ansible-project] Re: azure_rm_virtualmachine module causing error to start or stop VM

2019-06-05 Thread Tuyen Nguyen
An update on this is that if the VM is already on, and I use the playbook to turn off the VM, then after that all subsequent requests to manage that VM to turn on or off the VM will always work. On Tuesday, June 4, 2019 at 10:35:10 AM UTC-4, Tuyen Nguyen wrote: > > Hi > > I am getting the follo

Re: [ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Ryad karkar
Hi, Thanks for your answer !! :) But when i do this command : "sudo apt-get update", my probleme is now that update not finish, i have this message in end page : 100% [Working] and when next i try to install mssql-cli, Debian not found paquet mssql-cli ... ;( Merde Thanks for your answer ;)

Re: [ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Stefan Hornburg (Racke)
On 6/5/19 3:11 PM, Ryad karkar wrote: > Hi all, > > When i want do "sudo apt-get update" on my debian 8.11, i have this error : > > E: Malformed line 1 in source list /etc/apt/sources.list.d/mssql-cli.list > ([arch] is not an assignment) > E: The list of sources could not be read. > > the next

Re: [ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Jonathan Lozada De La Matta
This looks like a problem with the repository and not ansible. Looks like the file has issues itself. On Wed, Jun 5, 2019 at 10:26 AM Ryad karkar wrote: > Hi Jonathan, > > there is not task, on my terminal of my Debian 8.11 i will try to install > mssql-cli but it's not work and i have this erro

Re: [ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Ryad karkar
Hi Jonathan, there is not task, on my terminal of my Debian 8.11 i will try to install mssql-cli but it's not work and i have this error : E: Malformed line 1 in source list /etc/apt/sources.list.d/mssql-cli.list ([arch] is not an assignment) E: The list of sources could not be read. But when

[ansible-project] vmware_vm_facts - limit to set of matched names

2019-06-05 Thread Magnus Torstein
Is it possible to limit the vmware_vm_facts module to only return a subset of regex-matched vms? Big picture: I have a hostname standard that, in part, goes by a sequence # e.g. something-app-prod3a (where 3 is the sequence number). To ensure that all hostnames are unique, I need to check what

Re: [ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Jonathan Lozada De La Matta
can you share the tasks? On Wed, Jun 5, 2019 at 9:11 AM Ryad karkar wrote: > Hi all, > > When i want do "sudo apt-get update" on my debian 8.11, i have this error : > > E: Malformed line 1 in source list /etc/apt/sources.list.d/mssql-cli.list > ([arch] is not an assignment) > E: The list of sour

[ansible-project] Probleme mssql-cli on ansible

2019-06-05 Thread Ryad karkar
Hi all, When i want do "sudo apt-get update" on my debian 8.11, i have this error : E: Malformed line 1 in source list /etc/apt/sources.list.d/mssql-cli.list ([arch] is not an assignment) E: The list of sources could not be read. the next commands works for install mssql-cli : # Installer les

[ansible-project] Ignore whole block with ios_config module

2019-06-05 Thread Erjol Bane
Hi, is it possible to ignore the below block via the ios_config module with diff_ignore_lines? + certificate self-signed 01 + 3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 + 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 + 69666963 6174652D 3

Re: [ansible-project] add_host and --limit

2019-06-05 Thread Kai Stian Olstad
On 05.06.2019 09:58, Piotr Owcarz wrote: Out of curiousity, where does Ansible runtime keep the set of hosts which are the subject of a playbook, after being --limit-ed? Ansible has a list of special variables and the one that gives you that information is ansible_play_hosts_all. For all of

Re: [ansible-project] add_host and --limit

2019-06-05 Thread Piotr Owcarz
Thanks Kai, I solved this with delegate_to, fortunately it was only a few simple tasks to execute on host2. Out of curiousity, where does Ansible runtime keep the set of hosts which are the subject of a playbook, after being --limit-ed? Is it accesible from inside a playbook? Would a custom module

[ansible-project] Re: add_host and --limit

2019-06-05 Thread Knut Karevoll
Firstly you should have a look at the delegate_to which might be a better way at achieving what you want. But I am assuming there is a good reason for your current approach. The reason it does not work is that the limit is still in place after you have done an add_host. So when it gets to the s

Re: [ansible-project] need help with nested loop

2019-06-05 Thread Kai Stian Olstad
On 05.06.2019 08:29, eric sandgren wrote: First I'm a sysadmin not a developer I often use ansible to set up things in f5 -ltm i often need to add several hosts to a number of pools. The loadbalancing setup in f5 products in a glance consist of av VIP (virtual server) that is linked to a Pool c

Re: [ansible-project] add_host and --limit

2019-06-05 Thread Kai Stian Olstad
On 04.06.2019 14:58, Piotr Owcarz wrote: Hello All I have the following inventory: ... [group1] host1 [group2] host2 [all] host1 host2 ... and a playbook: - name: play1 hosts: group1 tasks: - add_host: name: "{{groups[group2] | first}}" groups: temp_group - debug: