Re: [ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Abhijeet Kasurde
Hi Gerry, vmware_vm_info finds all VMS irrespective of the datacenter (because it was designed that way) but snapshot takes datacenter and folder into consideration so I think you are good to go. Yes, I work at RH. On Tue, Dec 31, 2019 at 12:10 AM Gerry Maddock wrote: > Seems to be working on

[ansible-project] could not locate file in lookup to deploy authorized_keys

2019-12-30 Thread Chang Eric
I have a task like this - name: test > tags: key > authorized_key: > user: "{{ item }}" > state: present > key: "{{lookup('file', '/home/{{ item }}/.ssh/id_rsa.pub')}}" > > with_items: > - changch >

Re: [ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Gerry Maddock
Seems to be working on all datacenters (which is what I wanted) even though I only had one defined. Do you work @ Redhat? I was looking you up on LinkedIn. On Monday, December 30, 2019 at 10:46:09 AM UTC-5, Abhijeet Kasurde wrote: > > Hi Gerry, > > You may want to try this - Replace variables

Re: [ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Gerry Maddock
Abhijeet, that worked, thanks!. My next question is what if vcenter has multiple datacenters? I would like to do this for all datacenters. On Monday, December 30, 2019 at 10:46:09 AM UTC-5, Abhijeet Kasurde wrote: > > Hi Gerry, > > You may want to try this - Replace variables as per your setup

Re: [ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Gerry Maddock
Thanks Abhijeet, I'm testing now. Its complaining mapping values are not allowed in this context The offending line appears to be: - name Get a list of all VM names set_fact: ^ here Looks like it could be a spacing issue, but all spacing looks good. Still testing. On

[ansible-project] Re: unicode errors and inconsistency.

2019-12-30 Thread Andrew Graham
I was mistaken, the inconsistency was due to the password var being passed to ansible as extra-vars, this solves the unicode problem and avoids the conversion (default vars get converted to unicode, they cause the problem). I'd like to avoid specifying the password in extra-vars though for

Re: [ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Abhijeet Kasurde
Hi Gerry, You may want to try this - Replace variables as per your setup --- - hosts: localhost vars_files: - vcsim_vars.yml tasks: - name: Gather all VMs information vmware_vm_info: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}'

[ansible-project] Re: Ansible-Vmware snapshot question

2019-12-30 Thread Gerry Maddock
I've tried first running vmware_vm_info to get all vm's and debug from that shows all vms allong with other info on the vm's. I would like to loop the "guest_name" into the above snapshot removal using with_item, but not having any luck so far. I may be going at this the wrong way. Any help is

[ansible-project] unicode errors and inconsistency.

2019-12-30 Thread Andrew Graham
I get errors when passing some passwords into a shell command and I'd love some pointers on the best way out. The strange thing is, the ansible script works fine on centos 7 in AWS, but not on RHEL 7 on my local machine, and not in my ansible control vagrant virtualbox host (ubuntu 16). here

[ansible-project] Ansible create module connect MSSQL

2019-12-30 Thread Karther
Hello, I create module in file /library/module.py with this content : #!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.parsing.convert_bool import BOOLEANS DOCUMENTATION = ''' --- module: mssql_query author: Mohamed El

[ansible-project] Ansible-Vmware snapshot question

2019-12-30 Thread Gerry Maddock
Hello all, I have been using Ansible to manage snapshots for single specified vm's. Is there a way to have Ansible remove snapshots for all vm's in Vmware datacenter? If this is posssible, would you mind providing a play book example? Below is an example where I remove a snapshot from a single

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 05:39:27 -0800 (PST) Yehuda Pinhas wrote: > The result I get is: > [image: Ansible add vlans errors.PNG] The output of the task "add_host" is weird. "item.1" is empty in couple of lines or keeps the variables instead of the host's name. (I hesitate to hope that it helps)

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Yehuda Pinhas
> > > Alright! Thanks for your help so far, now it's working without errors. Ignore previous messages and lets talk about the current status. The result I get is: [image: Ansible add vlans errors.PNG] The result I'm expecting to see is that the ansible will run on each line inside

Re: [ansible-project] Re: Ansible play task if error in my running playbook

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 05:28:02 -0800 (PST) Karther wrote: > > If when my playbook running, and one moment stop because there is error ... > > I want execut one task .. ? See "Blocks error handling" https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html#blocks-error-handling

[ansible-project] Re: Ansible play task if error in my running playbook

2019-12-30 Thread Karther
U please !!! Someone can help me please Community Ansible !! :) Regards, Karther Le lundi 30 décembre 2019 10:42:58 UTC+1, Karther a écrit : > > Hello !! :) > > I want execut task in ansible if my playbook filed and stop ... > > *exemple :* > > If when my playbook running, and one moment

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 04:23:26 -0800 (PST) Yehuda Pinhas wrote: > vars: > vlan_id: 999 > vlan_name: TEST_VLAN_TEST > my_hosts: > - group: 'POC_ENV' > hosts: Wrong indentation. Fix: my_hosts: - group: 'POC_ENV' hosts: HTH, -vlado --

Re: [ansible-project] Ansible problem with command shell : mail

2019-12-30 Thread Karther
Thanks for your help Dick !! :) But i try this module mail and the module in documentation Ansible but it's not works : The error is : An exception occurred during task execution. To see the full traceback, use -vvv. The error was: socket.error: [Errno 101] Network is unreachable It's for

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Yehuda Pinhas
> > Alright so this is how my playbook looks like now: - name: Playing VLAN Configuration hosts: localhost # connection: local vars: vlan_id: 999 vlan_name: TEST_VLAN_TEST my_hosts: - group: 'POC_ENV' hosts: "{{

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 12:26:17 +0100 Vladimir Botka wrote: > On Mon, 30 Dec 2019 02:07:24 -0800 (PST) > Yehuda Pinhas wrote: > > - add_host: > name: "{{ item.1 }}" > groups: "{{ item.0.group }}" > ansible_ssh_private_key_file: /home/ansible/.ssh/id_rsa >

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 02:07:24 -0800 (PST) Yehuda Pinhas wrote: > Can you please take a look on my errors and try to help me figuring out why > I am getting them? Sure. As a working example, the playbook - hosts: localhost vars: my_hosts: - group: 'POC_ENV'

[ansible-project] Re: new tool: Visansible - Visualization of Ansibel-Facts

2019-12-30 Thread 'J Hawkesworth' via Ansible Project
Thanks for this. I have a couple of suggestions: Consider using 'argparse' so that the inventory file can be specified as it is hard coded to inventory.cfg at the moment. https://docs.python.org/3.8/library/argparse.html#module-argparse would be nice to be able to configure the path to the

Re: [ansible-project] Re: Cant SSH / PING to Network Devices

2019-12-30 Thread Nirmal Gauda
i added below in INVENTORY file ... no luck .. *leaf-1 ansible_ssh_pass=X ansible_ssh_user=* Thanks NIrmal On Sunday, 22 December 2019 13:05:53 UTC+5:30, Stefan Hornburg (Racke) wrote: > > On 12/22/19 5:51 AM, Nirmal Gauda wrote: > > on more thing : i have logged in to ansible server

[ansible-project] Citrix configuration

2019-12-30 Thread Raviteja Jinkala
Hi All, I have installed citrix DDC, PVS and Director using win_package. Can you please suggest Ansible module to configure citrixDDC, citrix PVS and citrixdirectoryconfig on Windows machine Thanks -- You received this message because you are subscribed to the Google Groups "Ansible

Re: [ansible-project] Ansible problem with command shell : mail

2019-12-30 Thread Dick Visser
Try using the native mail module instead of shell: https://docs.ansible.com/ansible/latest/modules/mail_module.html On Mon, 30 Dec 2019 at 11:36, Karther wrote: > > Hey !! > > With prompt shell on my linux this command works perfectly : > > mail -a "Content-Type: text/html" -s "Ansible

[ansible-project] How to change default umask by using the pamd module in Ansible ?

2019-12-30 Thread 'Konstantin' via Ansible Project
Hi guys! I want't to change my default umask to 027 by using Ansible pamd module. I was write a playbook for this. But changes are not made. What i'm do wrong ? --- - name: Update pamd rule's control in /etc/pam.d/common-session become: 'yes' become_method: sudo pamd: name:

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 01:31:54 -0800 (PST) Yehuda Pinhas wrote: > I still don't understand what these code lines used for in my case: > tasks: > - add_host: > name: "{{ item.1 }}" > groups: "{{ item.0.group }}" > loop: "{{ lookup('subelements', my_hosts,

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Jean-Yves LENHOF
Hi, It's difficult to understand what you want to do... Perhaps you should explain in plain english before trying to code it ? In your code, there's a "hosts" directive in your inventory You should not have it in this file ("hosts" directive is for playbooks) If you have multiple

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Yehuda Pinhas
> > Hi, > Can you please take a look on my errors and try to help me figuring out why I am getting them? This is my inventory code: - hosts: localhost vars: my_hosts: - group: 'POC_ENV' hosts: "{{ lookup('file',

[ansible-project] Ansible play task if error in my running playbook

2019-12-30 Thread Karther
Hello !! :) I want execut task in ansible if my playbook filed and stop ... *exemple :* If when my playbook running, and one moment stop because there is error ... I want execut one task .. ? If possible or not please ? i have not find in documentation Ansible please Thanks you very

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Yehuda Pinhas
> > Hi again, Thanks a lot for your reply. I still don't understand what these code lines used for in my case: tasks: - add_host: name: "{{ item.1 }}" groups: "{{ item.0.group }}" loop: "{{ lookup('subelements', my_hosts, 'hosts') }}" can you please

[ansible-project] Re: ansible Inventory

2019-12-30 Thread Arjan Goos
Can somebody help me? Op dinsdag 24 december 2019 12:21:48 UTC+1 schreef Arjan Goos: > > We have an cluster of windows machines and there are two types: web and esb > > And on these machines we have multiple jboss installations (one for each > application). And we want to manipulate the jboss

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 10:05:31 +0100 Vladimir Botka wrote: > For example, create the dictionary "my_hosts" Errata: For example, create the list of dictionaries "my_hosts" -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

Re: [ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Vladimir Botka
On Mon, 30 Dec 2019 00:19:47 -0800 (PST) Yehuda Pinhas wrote: > I need to build inventory file that contains 6 groups total and each group > will have around 100 hosts in it.. this is what I currently have. > > all: > hosts: > POC-ENV: > hosts: > ansible_host:

[ansible-project] Need help on building ansible inventory file properly

2019-12-30 Thread Yehuda Pinhas
Hi, I have been searching all over the internet and there isn't any good documentation that explains how to build my inventory properly. The official documentation is bad and there aren't any example on inet that I could find. Can you please help me? I need to build inventory file that