[ansible-project] hard disk serial mask by in register

2019-04-22 Thread cch
I wrote a playbook to collect CPU/RAM/HDD info in ansible using command "inxi" - name: run inxi to collect Ubuntu/Debian hardware info > become: yes > become_method: sudo > shell: "/usr/local/bin/inxi -c -Dxx -C -m" > register: du_hw_info > when: ansible_distribution == "Ubuntu" or

[ansible-project] Retrieving Cisco config with ios_facts module results in extra data in saved file

2019-04-22 Thread asilver
Hello, I'm using the ios_facts module and trying to retrieve the configuration from a Cisco CSR1000v. The configuration seems to be saved ok but the top of the file contains two lines that are invalid configuration commands. Thus, this file cannot be loaded into a router "as-is". The two

Re: [ansible-project] include_playbook / include tasks from Bitbucket?

2019-04-22 Thread Brian Coca
Ansible CANNOT read the files on the remote as part of the playbook, you need to either check them out on the controller (git + delegate_to: localhost) or 'fetch' them via the module with the same name. AWX will just checkout that repo onto the AWX machine and run Ansible 'locally' on those

Re: [ansible-project] command scp in ansible

2019-04-22 Thread Brian Coca
The copy module itself does not copy across machines, only on the same machine, as I said, the connection itself does the copy from controller to target (temp location) then executes the 'copy module' against that temp location (unless remote_src=true in which case copy module does all the work).

Re: [ansible-project] Ansible ansible_private_key_file and Hashicorp Vault

2019-04-22 Thread Brian Coca
depends on what you mean, you cannot read the key value from Hashicorp Vault into that variable, since that variable expects a path. You CAN write the key into a file from the H Vault and then pass that path into the variable. -- -- Brian Coca -- You received this message because you

Re: [ansible-project] host patterns doesn't work in group inventory

2019-04-22 Thread Brian Coca
They were never meant to work in inventory, they are used to 'select FROM inventory' but not to define it. See group_by and 'constructed' inventory plugin instead. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Best way to pass the password to dynamic inventory script

2019-04-22 Thread Brian Coca
Well, scripts are used via the 'script' plugin, so you are already using plugins. Scripts are very easy to create, they just need to output properly formatted JSON, but the problem with scripts, is that the are externally executed and cannot use facilities (like vault) that Ansible provides.

Re: [ansible-project] how do I email results that are easy to read and confirm each member was added successfully?

2019-04-22 Thread Brian Coca
Create a template that formats it nicely and use: body: '{{lookup("template", "pretty_email.j2")}}' You could try to do the same inline, but it ends up making the task hard to read and update. -- -- Brian Coca -- You received this message because you are subscribed to the Google

Re: [ansible-project] Passing mupltiple variables to template vars yml

2019-04-22 Thread Brian Coca
you don't give enough info, what is template-vars.yml? how do you load it? In any case, any solution is predicated on variable precedence, which is documented here: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable --

Re: [ansible-project] Best Practices with Vars

2019-04-22 Thread Brian Coca
You also have {{playbook_dir}} but there is no 'project' concept in Ansible. An approach I've used before is to define in 'group_vars/all.yml' something like: project_dir: '{{lookup("env", "MYPROJ")|default(playbook_dir)}}' -- -- Brian Coca -- You received this message because you

Re: [ansible-project] Failing to open socket due to port in unicode type

2019-04-22 Thread Brian Coca
All template results default to unicode strings, this is something Jinja2 does by default., but this is probably something we should fix in the telnet plugin by forcing port to always be an int. I'm unsure why telnet lib does not take a 'unicode string' as a 'string'. -- -- Brian Coca

Re: [ansible-project] When condition to check domainName

2019-04-22 Thread Brian Coca
Mustaches don't stack, when: ((domainName == "AD1") or (domainName == "AD2")) <= no mustaches needed when 'when:', you are trying to do double interpolation (conditionals have implicit {{ }}) Also you probably want to use 'in' instead of multiple comparisons: when: domainName in ["AD1",

Re: [ansible-project] Generate a sequence in a playbook using the inventory host group length

2019-04-22 Thread Brian Coca
mysequence: "{{range(0, groups['Test']|length + 1)|list }}" -- -- Brian Coca -- 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] Ansible & Windows Management

2019-04-22 Thread Tony Chia
To connect to windows from ansible you can use wintm instead of the default winrm connection type -- 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] Ansible & Windows Management

2019-04-22 Thread Tony Chia
You can connect using either ssh key or username / password -- 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

[ansible-project] Ansible Vault string in a single line

2019-04-22 Thread Tony Chia
One solution is use ansible-vault to decrypt the file and export the variable and have Jenkins read from the env var -- 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

Re: [ansible-project] Re: A10 Networks modules - Request for Testing and feedback

2019-04-22 Thread Pshem Kowalczyk
Hi, For most of the stuff it's just using the uri module, with something like this: name: "execute command: {{ exec.meta.description }}" uri: method: "{{ exec.meta.method }}" url: "https://{{ a10_device_ip }}{{ exec.meta.uri }}" return_content: true validate_certs: no body_format: "{{

[ansible-project] Generate a sequence in a playbook using the inventory host group length

2019-04-22 Thread Saranya N
I want to use inventory host groups length of hosts and inventory host group vars . For ex. [Test] Host0 Host1 Host2 Host3 Host4 [Test: vars] Port=1223 Based on length of test group I want to generate a sequence like this 0,1,2,3,4 Can someone please suggest how can I achieve this Inside a

Re: [ansible-project] Re: A10 Networks modules - Request for Testing and feedback

2019-04-22 Thread David Carrasco
Gotcha so does that mean you use Python scripts to leverage the A10 API, or do you somehow integrate Ansible with Python? Sent from my iPhone > On Apr 22, 2019, at 6:07 PM, Pshem Kowalczyk wrote: > > Hi, > > We use the A10s. Those modules turned out to be not particularly useful for > us,

[ansible-project] When condition to check domainName

2019-04-22 Thread Raj
Hello, I am running into an issue, this is simple playbook which tries to copy right config file based on Domain name, I tried executing below code snippet it's skipping the non prod and executing prod, Not sure whats wrong here, can some one throw a light here. - name: Gathering facts

Re: [ansible-project] Re: A10 Networks modules - Request for Testing and feedback

2019-04-22 Thread Pshem Kowalczyk
Hi, We use the A10s. Those modules turned out to be not particularly useful for us, so we ended up using the API extensively to get information (both config and operational) from the devices. kind regards Pshem On Tue, 23 Apr 2019 at 04:24, David Carrasco wrote: > I am very new to both

[ansible-project] Failing to open socket due to port in unicode type

2019-04-22 Thread Doron B
Hi Community, I'm facing some very basic problem. I'm trying to run open telnet session with a device. However, when I'm filling the port dynamically using jinja template, the port is passed as unicode thus I get the following error: error: getaddrinfo() argument 2 must be integer or string

Re: [ansible-project] win_copy azure ansible module not working

2019-04-22 Thread Jordan Borean
The first thing you want to do is create an inventory with a Windows group that contains the generic WinRM connection vars like; [windows] [windows:vars] ansible_connection=winrm ansible_port=5986 ansible_winrm_transport=ntlm ansible_winrm_server_cert_validation=ignore This group is empty as

[ansible-project] Re: install oracle RAC using Ansible

2019-04-22 Thread Ahmad S
also should mention , I am looking for two node RAC installation using ASM On Monday, April 22, 2019 at 3:18:49 PM UTC-4, Ahmad S wrote: > > I could not find a working example for this , can someone post a clear > project code ? I found few web links but the Git repository does not > match

[ansible-project] install oracle RAC using Ansible

2019-04-22 Thread Ahmad S
I could not find a working example for this , can someone post a clear project code ? I found few web links but the Git repository does not match the instructions. thanks -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

[ansible-project] Re: A10 Networks modules - Request for Testing and feedback

2019-04-22 Thread David Carrasco
I am very new to both Ansible and A10, but it's interesting to come across an article written 5 years ago of someone who already went down this road. I'm using the A10 in a network capacity (DDoS appliance) I was curious if there was any way to display or output "get_facts" or show commands. At

[ansible-project] Re: Adding a nested xml element using ansible xml module fails

2019-04-22 Thread Aliaa Yusuf
check this link it worked with me https://github.com/cmprescott/ansible-xml/issues/95 بتاريخ الأربعاء، 28 مارس، 2018 7:26:14 ص UTC+2، كتب Uvindra Dias Jayasinha: > > Im using Ansible 2.5 on Ubuntu 17.10 > > Given the following xml file > > > > > > > > Trying to add nested elements so

Re: [ansible-project] Adding a nested xml element using ansible xml module fails

2019-04-22 Thread Aliaa Yusuf
check this it worked with me https://github.com/cmprescott/ansible-xml/issues/95 بتاريخ الجمعة، 30 مارس، 2018 6:55:21 ص UTC+2، كتب Uvindra Dias Jayasinha: > > Thanks Kai > > On Wednesday, March 28, 2018 at 6:36:58 PM UTC+5:30, Kai Stian Olstad > wrote: >> >> On Wednesday, 28 March 2018

[ansible-project] Ansible Vault string in a single line

2019-04-22 Thread shamim Wilson
Hi Team, I am using ansible vault to encrypt an string and place the string in a file called vault.yml somthing like name1: value1 where value1 is an encrypted string. dbUser: PlainUser dbPasswd: vault | $ANSIBLE_VAULT;1.1;AES256

Re: [ansible-project] win_copy azure ansible module not working

2019-04-22 Thread dan
You could upload all these files (playbook, inventory, sample file to copy, etc) to a temporary GitHub.com or GitLab.com repository for us to look at it. The "unable to parse inventory" probably means formatting or other weirdness, not a bug or problem with Ansible. On Monday, April 22, 2019

Re: [ansible-project] win_copy azure ansible module not working

2019-04-22 Thread gottumukkala srija
Hi, I tried changing the format of the inventory but still the same issue. Not sure what else to be done. I mentioned all the necessary modules for windows connection. Do you anything to suggest here? Thanks in Advance. On Thursday, April 18, 2019 at 6:41:08 PM UTC+5:30, d...@linder.org

Re: [ansible-project] Ping module status in CSV

2019-04-22 Thread Vandana Thakur
Further, to customize this. I now have the ping module output for target hosts. Now haw can i decide result code in the ping output. Like eg, if A(some string) is present in the ping output then Register RC = x if B(some string) is present in the ping output then Register RC =y these