Re: [ansible-project] Ansible vs. multiple Azure subscriptions

2019-02-19 Thread Jean-Yves LENHOF
Le 2019-02-19 10:46, Wawrzek Niewodniczanski a écrit : Hi, I have Azure with multiple subscriptions and I wonder what's the best way to switch between them. The main two methods described in docs are: - password, but I don't see a way to distinguish subscription - service principal, I still

[ansible-project] Ansible vs. multiple Azure subscriptions

2019-02-19 Thread Wawrzek Niewodniczanski
Hi, I have Azure with multiple subscriptions and I wonder what's the best way to switch between them. The main two methods described in docs are: - password, but I don't see a way to distinguish subscription - service principal, I still trying to figure out if I can use the same SP in many

Re: [ansible-project] Ansible vs. multiple Azure subscriptions

2019-02-19 Thread ameya agashe
Not sure how you deal but for me Azure CLI az login works best, login and just choose current subscription which you want to work on. Just change the current default subscription. Did you try with this approach? I liked this one. From memory, I don't think I created Service Principal for Ansible

[ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
Search keyword in "host_fqdn" variable. If the value has "lab.com" keyword in it, it should directly store the value to "host_fqdn" again or else it should add "lab.com" keyword to the value and store it to "host_fqdn" variable. Please assist. vars: host_fqdn: server host_fqdn: |

Re: [ansible-project] Ansible vs. multiple Azure subscriptions

2019-02-19 Thread Wawrzek Niewodniczanski
On Tue, 19 Feb 2019 at 11:08, ameya agashe wrote: > On Tue, Feb 19, 2019 at 8:47 PM Wawrzek Niewodniczanski > wrote: [...] >> I have Azure with multiple subscriptions and I wonder what's the best >> way to switch between them. [...] >> How do you deal with this? > Not sure how you deal but for

[ansible-project] Re: Having problems with a variable in vars_files

2019-02-19 Thread Adrian Sebastian Dutu
Can you run your playbook with -vvv then post the output? It's probably going to be a lot, so use https://pastebin.com/ . Check if beforehand for any sensitive information. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
Can you please confirm, if the below syntax is correct. I am getting error. vars_prompt: - name: host_fqdn prompt: Enter Hostname of a new VM private: no tasks: - set_fact: host_fqdn: "{{ host_fqdn if 'lab.com' in host_fqdn else host_fqdn

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
Sorry my bad, it missed it. it's working perfectly now, Thanks much !! TASK [debug] *** ok: [rchtest01] => { "host_fqdn": "rchtest01.lab.com" } On

[ansible-project] Getting error in using register module

2019-02-19 Thread sajal tiwari
Hello, I am getting below error while using register module with network modules(ios_command & nxos_command). Can someone help on the issue. ERROR! Module "register" shadows the name of a reserved keyword. Please rename or remove this module. Found at

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Kai Stian Olstad
On 19.02.2019 16:49, Pandu jh wrote: Can you please confirm, if the below syntax is correct. I am getting error. vars_prompt: - name: host_fqdn prompt: Enter Hostname of a new VM private: no tasks: - set_fact: host_fqdn: "{{ host_fqdn if

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
This was the error. TASK [set_fact] fatal: [rchtest01]: FAILED! => {"msg": "template error while templating string: expected token 'end of print statement',

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Kai Stian Olstad
On 19.02.2019 16:57, Pandu jh wrote: This was the error. TASK [set_fact] fatal: [rchtest01]: FAILED! => {"msg": "template error while templating string:

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
If possible could you please explain the syntax, It will be very helpful for me to use it in other cases. On Tuesday, 19 February 2019 21:36:41 UTC+5:30, Pandu jh wrote: > > Sorry my bad, it missed it. it's working perfectly now, Thanks much !! > > TASK [debug] >

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Kai Stian Olstad
On 19.02.2019 17:07, Pandu jh wrote: If possible could you please explain the syntax, It will be very helpful for me to use it in other cases. I could try, not sure if it's understandable Just split it in multiple lines [1] {{ host_fqdn [2] if 'lab.com' in host_fqdn [3] else [4] host_fqdn ~

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Kai Stian Olstad
On 19.02.2019 15:41, Pandu jh wrote: Search keyword in "host_fqdn" variable. If the value has "lab.com" keyword in it, it should directly store the value to "host_fqdn" again or else it should add "lab.com" keyword to the value and store it to "host_fqdn" variable. Please assist. vars:

Re: [ansible-project] Getting error in using register module

2019-02-19 Thread Karthik Chandrashekar
If you could show your code that would be much better to understand. On Tue, 19 Feb, 2019, 10:24 PM sajal tiwari Hello, > I am getting below error while using register module with network > modules(ios_command & nxos_command). > Can someone help on the issue. > > ERROR! Module "register" shadows

Re: [ansible-project] If condition in ansible jinja2 template

2019-02-19 Thread Pandu jh
Thank you so much for the explanation. -- 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+unsubscr...@googlegroups.com. To post to this group,

[ansible-project] Re: Getting error in using register module

2019-02-19 Thread sajal tiwari
The script being used. # For Cisco Devices - hosts: Cisco_SW gather_facts: true connection: local tasks: - name: show run ios_command: commands: - show run host: "{{ ansible_host }}" username: "{{ un }}" password: "{{ pwd }}"

Re: [ansible-project] Re: Getting error in using register module

2019-02-19 Thread Matt Martz
The problem for whatever reason, is that ansible has been instructed to look in /opt/rh/python27/root/usr/lib/python2.7/site-packages/setuptools/command/ for ansible modules. It located a file named register.py in that directory, and it is causing issues with ansible. You may have some

[ansible-project] How to configure windows server with ansible using yml

2019-02-19 Thread rajendar t
Hi All, 1)How to turn off IE enhanced security using ansible 2) is there any I can configure user account in Windows server by using yml Thanks Rajedar -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

[ansible-project] Re: Hostname mismatch: node X believes its host is different

2019-02-19 Thread mrplainswalker
Oops, sorry. I sent this to the wrong place. On Tuesday, February 19, 2019 at 12:51:57 PM UTC-8, Jordan Borean wrote: > > This doesn't sound like an issue with Ansible but something specific to > RabbitMQ. You are better off asking those communities for help with this. > > Thanks > > Jordan >

[ansible-project] Getting MemoryError when executing task hdfs dfs -format; how to fix / troubleshoot?

2019-02-19 Thread dgoldenberg
We have a task in our Ansible based deploy which performs formatting of HDFS using the hdfs dfs -format command. This command causes a MemoryError. We can see that there is a Python process on the target box which gobbles up ~32GB of memory and then the failure occurs. How can we

[ansible-project] simple IP lookup plugin

2019-02-19 Thread Michael Ströder
HI! Is there a simple example module how to implement an ansible (connection) plugin for looking up an IP address for establishing the SSH connection? I have a deployment where no DNS entries are present prior to initial host configuration, but I can access another (LDAP) database to query

[ansible-project] Re: Hostname mismatch: node X believes its host is different

2019-02-19 Thread Jordan Borean
This doesn't sound like an issue with Ansible but something specific to RabbitMQ. You are better off asking those communities for help with this. Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

Re: [ansible-project] simple IP lookup plugin

2019-02-19 Thread Kai Stian Olstad
On 19.02.2019 21:31, Michael Ströder wrote: > Is there a simple example module how to implement an ansible (connection) > plugin for looking up an IP address for establishing the SSH connection? > > I have a deployment where no DNS entries are present prior to initial host > configuration, but

[ansible-project] Keys for role names in "roles:" section

2019-02-19 Thread Rich Fletcher
At some point in the past, the documentation specified that role names (for roles with arguments) in the roles: section were indicated by a name: key. Now, the documentation examples show that role names in that section are indicated by a "role:" key. Both syntaxes seem to work in 2.7, but:

[ansible-project] optional template?

2019-02-19 Thread Guy Matz
Hi! I am installing some packages based on a list, and I would like to put a config file in place for each package, however I would like the config file to be optional. For example, if I have this list of packages to install: pkgs: - a - b - c I have code that install the pkgs, and I would

[ansible-project] Hostname mismatch: node X believes its host is different

2019-02-19 Thread mrplainswalker
Hi All, I realize that this topic is incredibly popular and I've gone through about 10 others talking about the same thing, but nothing they suggest seems to work, so here's another one... I have Erlang OTP 20.2 and RabbitMQ 3.7.3 installed on 2 fresh virtual machines running Windows Server

Re: [ansible-project] Loop over two lists variables in inventory file via jinja2 -- similar to zip() function in python

2019-02-19 Thread Ansar Sahit
Just to add/explain more. The jinja2 template with create an yaml with two stanzas per host, with first stanza containing first value of var1 n var2 And second stanza with second value of var1 n var2. So entire yaml generated in this way will have two stanza per host --- yamlinput: - Stanza1 -

Re: [ansible-project] Loop over two lists variables in inventory file via jinja2 -- similar to zip() function in python

2019-02-19 Thread Ansar Sahit
Just to add/explain more. The jinja2 template should create an yaml with two stanzas per host, with first stanza containing first value of var1 n var2 And second stanza with second value of var1 n var2. So entire yaml generated in this way will have two stanza per host --- yamlinput: - Stanza1

Re: [ansible-project] Re: Getting error in using register module

2019-02-19 Thread sajal tiwari
Below is the output from the command. DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = [u'/usr/share/my_modules', u'/opt/rh/python27/root/usr/lib/python2.7/site-packages/icontrol', u'/usr/lib/python2.7/site-packages/ansible/utils/module_docs_fragments']

[ansible-project] Loop over two lists variables in inventory file via jinja2 -- similar to zip() function in python

2019-02-19 Thread sahitansar
my inventory file is like below with more additional group_vars and host_vars that I havent mentioned here for simplicity: I dont want to use host_vars as of now. [qa] host1 var1='["hi" , "xy"]' var2=[435345, 3425634] host1 var2='["asd" , "er"]' var2=[212, 456] host1 var3='["zxc" , "ghhj"]'