[ansible-project] Create a variable that contains other variable values with labels

2019-05-02 Thread 'Mark Tovey' via Ansible Project
I have a list: list1 - value1 - value2 and I want to use set_fact create a new variable that contains these variables with a label in front of them, so that this debug task: - debug: msg: "{{var1}}" would result in output that looks like this: label value1

[ansible-project] leftover on AMI after using Ansible with Packer

2019-05-02 Thread Wawrzek Niewodniczanski
Hello, I use Ansible to configure OS which is base for Packer to create AMI for AWS and disk image for Azure. AMI bases on Amazon Linux and Azure image on Ubuntu image. The whole process works fine, however somehow on AMI in /home/ec2-user there is (an empty) ~wawrzek/.ansible/tmp directory.

[ansible-project] Q on hostvars access to inventory variables ad-hoc vs playbook

2019-05-02 Thread countryroad62
I seem to be able to query hostvars for a particular host from the command line and get at the inventory variables but I haven't figured out how to do this in a playbook. Might it be from hostvars being lazily loaded - or my lack of understanding how to access hostvars inventory variables

Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-02 Thread Guy Matz
YAY!! On Wed, May 1, 2019 at 5:04 PM James Cassell wrote: > On Wed, May 1, 2019, at 4:27 PM, Guy Matz wrote: > > Thanks, but that didn't exactly help. I'm not able to figure out what > I'm > > missing . . . any other thoughts? Thanks again!!! > > here's the output from '--only-changed': > >

Re: [ansible-project] conflicting action statements: shell, async

2019-05-02 Thread Brian Coca
This should show 'configured paths' for searching for a module `ansible -m debug -a 'msg={{ lookup("config", "DEFAULT_MODULE_PATH") }}' localhhost`, to this you need to add any library/ directories in your roles or adjacent to your playbooks. -- -- Brian Coca -- You received this

Re: [ansible-project] i can't list hard disk info

2019-05-02 Thread lander7500
oooh goood. THANK YOU VERY MUCH <3 -- 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

[ansible-project] how to get the total failed count using ansible

2019-05-02 Thread Bubunia Patra
Hi all, I am writing a ansible playbook which will gather all the failed count from script and after sum it will display in the report. For example: shell script fails that is called from the ansible fails with exit 1, 2 for different cases with diff error message after the script runs in

Re: [ansible-project] how to use ansible -m setup in playbook?

2019-05-02 Thread Raghavendra Rao
Please don't spam this mailing list with repetitive queries. On Thu, 2 May 2019 at 16:38, Jonathan Lozada De La Matta < jloza...@redhat.com> wrote: > - name: Setup information > setup: > > if using the defaults. Look at > https://docs.ansible.com/ansible/latest/modules/setup_module.html > > On

Re: [ansible-project] how to obtain ip info

2019-05-02 Thread Raghavendra Rao
https://docs.ansible.com/ansible/latest/modules/setup_module.html Also run this adhoc command to gather info about all your hosts at once, then check which variables can be used for IP related information: #ansible all -m setup | less On Thu, 2 May 2019 at 14:18, wrote: > Can you give me a

Re: [ansible-project] how to obtain ip info

2019-05-02 Thread Stephen John Smoogen
On Thu, 2 May 2019 at 04:48, wrote: > Can you give me a documentation? > https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html https://stackoverflow.com/questions/52291149/ansible-to-get-the-netmask-in-cidr

Re: [ansible-project] i can't list object

2019-05-02 Thread lander7500
oh my god. Thank very much <3 -- 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, send email

[ansible-project] Re: How to use vars to work with to_datetime

2019-05-02 Thread Andy Magana
So I have resolved my issue thanks to others advice what worked is to 1. stat the file get its mtime and 2. register and 3. assign it to a variable and the same for the current date and 4. put both variables and include to convert them to an INT into a jinja subtraction arithmetic and divide

Re: [ansible-project] i can't list hard disk info

2019-05-02 Thread Sebastian Meyer
On 02.05.19 13:14, Jean-Yves LENHOF wrote: >> and the result is: >> >> ok: [host1] => { >> "msg": { >> "0": { >>     "backing_datastore": "datastore1", [...] >> }, >> "1": { >>     "backing_datastore": "datastore1", [...] >> } >>     } >> } >> >> Good, i need second ("1") hard disk info, but when

Re: [ansible-project] i can't list hard disk info

2019-05-02 Thread lander7500
When i'm use disk_facts.guest_disk_facts[1] the result is: fatal: [host1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: dict object has no element 1\n\nThe error appears to have been in '/root/playbook/operations/ListVMvalues.yml': line 50,

Re: [ansible-project] i can't list object

2019-05-02 Thread Jean-Yves LENHOF
Le 02/05/2019 à 08:40, lander7...@gmail.com a écrit : Hi, i'm use this playbook --- - hosts: host1 gather_facts: false connection: local tasks:     - name: Gather fact datastore vmware_datastore_facts:   hostname: "{{ hostname }}"   username: "{{ username }}"   password: "{{ password }}"  

Re: [ansible-project] i can't list hard disk info

2019-05-02 Thread Jean-Yves LENHOF
Le 02/05/2019 à 09:02, lander7...@gmail.com a écrit : Hi, i use this playbook: --- - hosts: host1 gather_facts: false connection: local tasks: - name: Gather disk facts from virtual machine using name   vmware_guest_disk_facts:     # Unirse a vsphere     hostname: "{{ hostname }}"    

Re: [ansible-project] how to use ansible -m setup in playbook?

2019-05-02 Thread Jonathan Lozada De La Matta
- name: Setup information setup: if using the defaults. Look at https://docs.ansible.com/ansible/latest/modules/setup_module.html On Thu, May 2, 2019 at 5:49 AM wrote: > I want to use ansible -m setup in playbook to take ip information and I > dont know how to do it > > -- > You received

[ansible-project] how to use ansible -m setup in playbook?

2019-05-02 Thread lander7500
I want to use ansible -m setup in playbook to take ip information and I dont know how to do it -- 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

Re: [ansible-project] how to obtain ip info

2019-05-02 Thread lander7500
Can you give me a documentation? -- 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, send

Re: [ansible-project] how to obtain ip info

2019-05-02 Thread lander7500
Can you give me a documentation -- 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, send

Re: [ansible-project] how to obtain ip info

2019-05-02 Thread Raghavendra Rao
Use ansible facts. Read about them more in the documentation section. On Thu, 2 May 2019, 12:44 , wrote: > I need ip, gateway and netmask info > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop

[ansible-project] how to obtain ip info

2019-05-02 Thread lander7500
I need ip, gateway and netmask info -- 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, send

[ansible-project] i can't list hard disk info

2019-05-02 Thread lander7500
Hi, i use this playbook: --- - hosts: host1 gather_facts: false connection: local tasks: - name: Gather disk facts from virtual machine using name vmware_guest_disk_facts: # Unirse a vsphere hostname: "{{ hostname }}" username: "{{ username }}"

[ansible-project] how to create a new hard disk?

2019-05-02 Thread lander7500
I know to use this task: - name: Add HardDisk vmware_guest: hostname: "{{ hostname }}" username: "{{ username }}" password: "{{ password }}" validate_certs: no folder: / name: "{{vm}}" disk: - size_gb: "{{gb}}" Create a

[ansible-project] i can't list object

2019-05-02 Thread lander7500
Hi, i'm use this playbook --- - hosts: host1 gather_facts: false connection: local tasks: - name: Gather fact datastore vmware_datastore_facts: hostname: "{{ hostname }}" username: "{{ username }}" password: "{{ password }}" datacenter: Datacenter

[ansible-project] Re: socket.timout() while connecting to a junos devices via network_cli

2019-05-02 Thread vicky . singh
There was some additional information in the log file (/opt/log/ansible.log), so posting its content 2019-05-02 11:58:58,802 p=7595 u=vicky | ansible-playbook 2.7.10 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/vicky/.ansible/plugins/modules',

[ansible-project] socket.timout() while connecting to a junos devices via network_cli

2019-05-02 Thread vicky . singh
I was exploring ansible and the first step i tried was getting some information from a router (a virtual gns3 image). I am able to connect to the device using ssh, get into it's cli and run commands normally but not via ansible. I ran asnible playbook with -v option( ansible-playbook -v