Re: [ansible-project] Ansible host variable access

2017-09-07 Thread parwinderjit singh
Thanks for the help Mr Kai. I really appreciat 👍 On Fri, Sep 8, 2017 at 11:38 AM, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 08. sep. 2017 05:59, parwinderjit singh wrote: > >> My host file is >> >> [splunk-head] >> parv-vm-01 ansible_ssh_host=10.48.21.99 host_fqdn=parv-vm-0

Re: [ansible-project] Ansible host variable access

2017-09-07 Thread Kai Stian Olstad
On 08. sep. 2017 05:59, parwinderjit singh wrote: My host file is [splunk-head] parv-vm-01 ansible_ssh_host=10.48.21.99 host_fqdn=parv-vm-01 [splunk-indexer] parv-vm-02 ansible_ssh_host=10.48.21.94 host_fqdn1=parv-vm-02 parv-vm-03 ansible_ssh_host=10.48.21.96 host_fqdn=parv-vm-03 parv-vm-04 ans

Re: [ansible-project] Ansible 2.4 and yum tasks on CentOS 5

2017-09-07 Thread Toshio Kuratomi
You appear to need the yum python module for the python2.6 install. That may not be an easy undertaking. If you do want to try it, I'd start with the yum rpm for CentOS 6 as CentOS 6 also used python2.6. Experience building software from source is recommended. If you don't have this then runni

[ansible-project] Ansible host variable access

2017-09-07 Thread parwinderjit singh
Hi, Need some help My host file is [splunk-head] parv-vm-01 ansible_ssh_host=10.48.21.99 host_fqdn=parv-vm-01 [splunk-indexer] parv-vm-02 ansible_ssh_host=10.48.21.94 host_fqdn1=parv-vm-02 parv-vm-03 ansible_ssh_host=10.48.21.96 host_fqdn=parv-vm-03 parv-vm-04 ansible_ssh_host=10.48.21.86 hos

[ansible-project] Re: win_command not able to execute command file on win 2008

2017-09-07 Thread Jordan Borean
Apart from updating the Server OS to 2008 R2 the only way I know how to get the output of a batch script is to use win_shell while changing the active code page. An example of running a valid and failing command can be found - name: create test batch file > win_copy: > dest: C:\temp\test.b

[ansible-project] Assistance with sefcontext module

2017-09-07 Thread William Muriithi
Afternoon, I am attempting to convert a task that currently use shell to use sefcontext module and its not working as documented. Have anyone previously used this module successfully? Below is my intention and observation. The current working solution chcon -R -t httpd_sys_rw_content_t {{svn_ro

Re: [ansible-project] Running tasks in parallel in a playbook

2017-09-07 Thread Giovanni Gaglione
I've solved it this way - https://github.com/ansible/ansible/issues/12086#issuecomment-327927275 On Thursday, September 7, 2017 at 8:14:35 PM UTC+2, Giovanni Gaglione wrote: > > I basically need the index of the current hostname, but I can't find a > way. > {{ groups['browsers'].index(inventory

Re: [ansible-project] Is there a way to access the host index in a group? I.e. want number in the hosts group am i?

2017-09-07 Thread Giovanni Gaglione
I've solved it this way - https://github.com/ansible/ansible/issues/12086#issuecomment-327927275 On Thursday, September 7, 2017 at 10:22:52 PM UTC+2, Giovanni Gaglione wrote: > > Hi Matt, > > This solution does not work well when a group has multiple hostname that > are all the same. > > E.g. >

Re: [ansible-project] Finding unpartitioned drives

2017-09-07 Thread Jean-Yves LENHOF
ansible_devices could interesting to look after... Le 07/09/2017 à 22:16, KK a écrit : > Thanks JYL for the information. Is there any easy way to get hold of > the drives rather than looping over the registered value. > > On Thursday, September 7, 2017 at 2:34:47 AM UTC-7, Jean-Yves LENHOF > wrot

Re: [ansible-project] Is there a way to access the host index in a group? I.e. want number in the hosts group am i?

2017-09-07 Thread Giovanni Gaglione
Hi Matt, This solution does not work well when a group has multiple hostname that are all the same. E.g. [my-hosts] > 192.168.1.1 > 192.168.1.1 > 192.168.1.1 > 192.168.1.1 In this case, do you recommend a way to get the index of the current host? On Thursday, November 5, 2015 at 1:26:48 PM

Re: [ansible-project] Finding unpartitioned drives

2017-09-07 Thread KK
Thanks JYL for the information. Is there any easy way to get hold of the drives rather than looping over the registered value. On Thursday, September 7, 2017 at 2:34:47 AM UTC-7, Jean-Yves LENHOF wrote: > > > > Le 07/09/2017 à 08:14, KK a écrit : > > Hi > > > > Am having trouble to find unpart

[ansible-project] Re: win_command not able to execute command file on win 2008

2017-09-07 Thread 'J Hawkesworth' via Ansible Project
It sounds like you have hit this issue: https://github.com/ansible/ansible/issues/21915 I guess you could try updating the powershell / windows management framework version to see if that helps, or perhaps upgrade the machine to S2008R2? All the best, Jon On Wednesday, September 6, 2017 at 8

Re: [ansible-project] Running tasks in parallel in a playbook

2017-09-07 Thread Giovanni Gaglione
I basically need the index of the current hostname, but I can't find a way. {{ groups['browsers'].index(inventory_hostname) }} will return always the same index (because the hostname is always the same). I couldn't find any other way. Do you know if the API offers something more appropriate? St

Re: [ansible-project] get the list of packages to update.

2017-09-07 Thread Kai Stian Olstad
On 07. sep. 2017 14:45, Josu Vilda wrote: I have seen that the yum module has the option to install the lastest, but not to check the packages Use the yum module and run Ansible in check mode https://docs.ansible.com/ansible/latest/playbooks_checkmode.html -- Kai Stian Olstad -- You receive

[ansible-project] openstack-ansible setup-infrastructure.yml failed to complete TASK [resolvconf : Gather variables for each operating system]

2017-09-07 Thread norbel ambanumben
here are the saple logs TASK [resolvconf : Gather variables for each operating system] ** task path: /etc/ansible/roles/resolvconf/tasks/main.yml:16 Thursday 07 September 2017 18:47:51 +0100 (0:00:00.024) 0:00

Re: [ansible-project] get_url throws No space left error

2017-09-07 Thread rambius
четвъртък, 7 септември 2017 г., 12:14:44 UTC-4, Jean-Yves LENHOF написа: > > > Hi, > > RTFM http://docs.ansible.com/ansible/latest/get_url_module.html > > tmp_dest is what you are looking for > Thank you! tmp_dest fixed the problem.. Regards Ivan -- You received this message because you are

Re: [ansible-project] Running tasks in parallel in a playbook

2017-09-07 Thread Giovanni Gaglione
Hi Jesse, Could you make an example of this solution? My scenario is like the following: [myhost] 192.168.1.1 192.168.1.1 192.168.1.1 192.168.1.1 192.168.1.1 192.168.1.1 192.168.1.1 But then, when ansible iterates over these host, I would like to have a unique name of the host (example `192.16

Re: [ansible-project] get_url throws No space left error

2017-09-07 Thread Jean-Yves LENHOF
Le 07/09/2017 à 17:39, rambius a écrit : > Hello, > > I have the following playbook: > > --- > - name: Setup Upsource > hosts: upsource > tasks: > - name: fetch upsource > local_action: get_url url="{{ upsource_url }}" dest="{{ > installers_dir }}/{{ upsource_bundle }}" validate_certs="no

[ansible-project] Adding role-file to ansible-playbook

2017-09-07 Thread Thurston Stone
Since a role file is a great way to download modules from git or galaxy, I was wondering if it made sense to put the role-file option in ansible-playbook? So, rather than: ansible-galaxy install -r role_file.yml -p path/to/roles ansible-playbook mainPlaybook.yml it could be simplified to: ansib

Re: [ansible-project] Newbie question on syntax

2017-09-07 Thread Kai Stian Olstad
On torsdag 7. september 2017 16.55.04 CEST Kenny Barnes wrote: > Not sure what you mean my removing the parentheses and text between. > Doesn't that equal blank?? > This is my complete yml file> > --- > - name: Get Existing UCS Information > hosts: ucs > connection: local > gather_facts: no

[ansible-project] get_url throws No space left error

2017-09-07 Thread rambius
Hello, I have the following playbook: --- - name: Setup Upsource hosts: upsource tasks: - name: fetch upsource local_action: get_url url="{{ upsource_url }}" dest="{{ installers_dir }}/{{ upsource_bundle }}" validate_certs="no" - name: create upsource directory file: path="{{ ups

Re: [ansible-project] Re: Task execution only for special items within a loop

2017-09-07 Thread James Tanner
Calling set_fact with an item loop is not going to slice the original list. Your best best is to make a custom filter plugin to handle this. An example might look like: - set_fact: newlist: "{{ bundle_artifacts|artifact_reduce(product, env) }}" http://docs.ansible.com/ansible/latest/dev_gu

Re: [ansible-project] Newbie question on syntax

2017-09-07 Thread Kenny Barnes
Not sure what you mean my removing the parentheses and text between. Doesn't that equal blank?? This is my complete yml file> --- - name: Get Existing UCS Information hosts: ucs connection: local gather_facts: no tasks: - name: Pull WWPNs from UCS getucswwpns: hosts= {{

[ansible-project] Re: Task execution only for special items within a loop

2017-09-07 Thread 'Tom Bartsch' via Ansible Project
Has anybody an idea or is this impossible? -- 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

Re: [ansible-project] Newbie question on syntax

2017-09-07 Thread Kai Stian Olstad
On 05.09.2017 20:51, Kenny Barnes wrote: Keep getting an error when running the following playbook. Copied from gethub and watch youtube running the same w/o error. --- - name: Get Existing UCS Information hosts: ucs (Runs on UCS group in the inv file) connection: local gather_facts: no

Re: [ansible-project] How can I set a default that includes information from a variable?

2017-09-07 Thread Kai Stian Olstad
On 06.09.2017 23:00, David Reagan wrote: I've tried the following code: - name: ensure users exist. when: item.value.state is defined user: state: "{{ item.value.state }}" name: "{{ item.value.username }}" comment: "{{ item.value.fullname }}" password: "{{ item.value.crypted_

[ansible-project] get the list of packages to update.

2017-09-07 Thread Josu Vilda
Hi all, I would like to automate a task to check the list of packages that need to be updated in my server farm with ansible. Is there any way to do it? I have seen that the yum module has the option to install the lastest, but not to check the packages and I have tried it from shell, shell

Re: [ansible-project] Re: Newbie question on syntax

2017-09-07 Thread Jean-Yves LENHOF
Le 07/09/2017 à 03:17, Kenny Barnes a écrit : > I have moved the alignment every way possible it seams. Will continue > to read... > > On Tue, Sep 5, 2017 at 4:41 PM, Jean-Yves LENHOF > mailto:jean-y...@lenhof.eu.org>> wrote: > > > > Le 05/09/2017 à 22:26, Kenny Barnes a écrit : > > Than

Re: [ansible-project] Finding unpartitioned drives

2017-09-07 Thread Jean-Yves LENHOF
Le 07/09/2017 à 08:14, KK a écrit : > Hi > > Am having trouble to find unpartitioned drives through ansible. > I want all the unpartitioned drives put to a variable > > example: > > I have sda,sdb and sdc where sda is partitioned and sdb,sdc is left > unpartitioned. I want the playbook to regist

[ansible-project] Re: Ansible roles stored in Git

2017-09-07 Thread Mischa ter Smitten
We have one repository as our "ansible root" (e.g. /etc/ansible). This repository includes all our roles (as git submodules ) that are in separate repositories. This gives a lot of versioning power, but also nice separation. # ll total 264K

[ansible-project] Re: validate a file's content and reporting

2017-09-07 Thread 'Ask 21' via Ansible Project
Thanks to all, i wasn't searching for authorized_key module but as Dick said - check is the option i prefer. Also thanks for the hint about authorized_keys - still found some servers where users added their key in that file. regards Stefan Am Mittwoch, 6. September 2017 12:43:21 UTC+2 schrieb