[ansible-project] Creating users & groups with vars - not working

2017-07-06 Thread Anfield
Trying to create users and groups with vars inline...this is not working..what am I missing here? --- # Users and Groups - hosts: localhost become: yes vars: groups: - devops - dbadbmins - serveradmins users: - frank - joe - dave

[ansible-project] Create users and groups using with_files

2017-07-06 Thread Anfield
Trying to create groups and then users using with files and its not working..How should the lists be represented in the groups vars file and the users vars file? It doesnt like it just as text below..how am I supposed to list the values out? How do people normally create a few users and groups

Re: [ansible-project] How to use set_fact to set a new host fact based on when conditionals.

2017-07-06 Thread Alex Lien
Hi Brian, I made the changes based on your suggestions and they work fine. Thank You very much for your help. Regards, Alex On Thu, Jul 6, 2017 at 6:06 AM, Brian Coca wrote: > using set_fact that way requires you to check if those vars are > defined, i believe this is a

[ansible-project] Re: Baremetal provisioning on Windows Hyper-V

2017-07-06 Thread mattdavi
Now that we're shipping win_dsc in the box (2.4/devel), you might also want to have a look at the xHyperV DSC module... On Thursday, July 6, 2017 at 2:07:28 PM UTC-7, David Armstrong wrote: > > Add me as a +1 for Hyper-V / SCVMM support. > > We are a mixed VMware and Hyper-V shop. We looked at

Re: [ansible-project] Using Cpanel with Ansible

2017-07-06 Thread Fayad
I tried increasing the limits but it won't take effect unless i disable shell fork bomb protection from WHM interface. And is not a good idea to disable it. Fayad Sent from my OnePlus One On 06-Jul-2017 10:31 PM, "Kai Stian Olstad" wrote: On 05. juli 2017

Re: [ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Listing
On Thursday, July 6, 2017 at 10:58:18 PM UTC+2, Kai Stian Olstad wrote: > > On 06. juli 2017 22:47, Listing wrote: > > with_items: groups['all:!excluded_group'] does not seem to work. Have > you > > got any idea how to exclude here? :) > > with_items: "{{ groups['all'] |

[ansible-project] Re: Baremetal provisioning on Windows Hyper-V

2017-07-06 Thread David Armstrong
Add me as a +1 for Hyper-V / SCVMM support. We are a mixed VMware and Hyper-V shop. We looked at vRealize Automation (vRA) but it's support for Hyper-V networking is lacking, therefore we cannot use it. I am also looking into Kelverion's VM provisioning stack because they claim to be able to

Re: [ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Kai Stian Olstad
On 06. juli 2017 22:47, Listing wrote: with_items: groups['all:!excluded_group'] does not seem to work. Have you got any idea how to exclude here? :) with_items: "{{ groups['all'] | difference(groups['excluded_group']) }}" -- Kai Stian Olstad -- You received this message because you are

Re: [ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Kai Stian Olstad
On 06. juli 2017 21:54, Listing wrote: HI al, I am running a playbook on a set of hosts of which I expect them to be offline. I want to check every 10 seconds whether they are online or not and then output a message when all is running, or another message when all is not running after 10

[ansible-project] Re: error message with adhoc command from the command line

2017-07-06 Thread B Holmes
I've hit this problem too, ever find a solution? On Tuesday, May 30, 2017 at 8:32:43 AM UTC+1, Daley Okuwa wrote: > > kuwa@ubuntu:/etc/ansible$ ansible all -i hosts -u dokuwa1 --ask-pass -m > yum -a "name=httpd state=present" --become-user=root --ask-become-pass > SSH password: > SUDO

[ansible-project] Clear host errors not working as supposed - cannot retry task on unreachable host

2017-07-06 Thread Listing
HI al, I am running a playbook on a set of hosts of which I expect them to be offline. I want to check every 10 seconds whether they are online or not and then output a message when all is running, or another message when all is not running after 10 retries for instance. I am getting 'host

Re: [ansible-project] How to run a task on a specific host which is not part of the hosts scope for the playbook?

2017-07-06 Thread Kai Stian Olstad
On 06. juli 2017 11:49, Rasmus Sjørslev wrote: how (if possible) can i run a task using eg. win_shell against a specific host that takes a variable from the overall playbook it is being initialised from? I have tried an - include: dns_changes.yml hosts: windows_server vars: ip: "{{

Re: [ansible-project] backward incompatible change in module find in ansible 2.3

2017-07-06 Thread Kai Stian Olstad
On 06. juli 2017 13:33, Renaud Michel wrote: I suppose it is too late to report this as a bug, as ansible 2.3 has been released for some time already, changing it to be compatible with previous versions would break it for people who stated using it with ansible 2.3. It seams that the find

[ansible-project] Re: File beat installation and configuration with Ansible

2017-07-06 Thread Sergey Baranov
Here is my example. I am using hash_behaviour = merge. Layout: ├── group_vars │ ├── php-fpm │ └── nginx ├── roles │ └── filebeat │ ├── defaults │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── README.md │

Re: [ansible-project] could not SSH to Cisco using CentOS

2017-07-06 Thread Kai Stian Olstad
On 06. juli 2017 17:56, Edvinas K wrote: installed linux (CENTOS) and trying to run an ansible test ping. straight from linux box ssh cisco@172.1.1.2 works. but the *"ansible -m ping all"* doesnt. Ansible ping is a task that copies a python file to the remote an execute the file. Cisco

[ansible-project] How to run a task on a specific host which is not part of the hosts scope for the playbook?

2017-07-06 Thread Rasmus Sjørslev
What i am trying to achieve: I have a playbook that provisions some virtual machines by running a role: --- - hosts: localhost gather_facts: false connection: local vars_files: - vm_data.yml roles: - { role: common } ... the common role logs into phpIPAM and gets some subnet

Re: [ansible-project] Cannot read group_variable from role task - Ansible 2.3.1.0 (works fine with 2.1) -

2017-07-06 Thread Paolo Galizzi
I confirm this resolve my issue, thanks! On Thursday, July 6, 2017 at 11:23:03 AM UTC+2, Kai Stian Olstad wrote: > > On 05.07.2017 12:53, Paolo Galizzi wrote: > > - name: 'Item' > > debug: > > var: item > > with_items: databases > > > > > > - name: 'Item Name' > > debug: > >

[ansible-project] Re: Cannot read group_variable from role task - Ansible 2.3.1.0 (works fine with 2.1) -

2017-07-06 Thread Rick Stokkingreef
Paulo, I Think the fix should be: - name: 'Item' debug: var: item with_items: "{{ databases}}" Op donderdag 6 juli 2017 00:54:11 UTC+2 schreef Paolo Galizzi: > > Hello, > > I have some trouble on reusing a code wrote for Ansible 2.1.1.0 with > Ansible 2.3.1.0. > With Ansible 2.3 when

[ansible-project] backward incompatible change in module find in ansible 2.3

2017-07-06 Thread Renaud Michel
Hello Thought I should mention this somewhere, there has been an incompatible change in the find module in ansible 2.3, which is not mentioned in the changelog (or I didn't understand it). Until ansible 2.2, the file_type option accepted two values, 'file' and 'directory'. Due to the use of the

[ansible-project] could not SSH to Cisco using CentOS

2017-07-06 Thread Edvinas K
Hello, installed linux (CENTOS) and trying to run an ansible test ping. straight from linux box ssh cisco@172.1.1.2 works. but the *"ansible -m ping all"* doesnt. Maybe it's clear where could be a problem from this output: [osboxes@osboxes ~]$ ansible -m ping servers -vvv Using

[ansible-project] Ansible with windows server 2008 r2 sp1 - sysprep

2017-07-06 Thread Fernando Henrique Borges
Hi. I deployed one VM (Vcenter Server/ESXi 5.5.0) from windows server 2008 r2 template using ansible playbook. Now I 'd like to initialize it, but the vm is configured with sysprep, When the ansible start the vm, it stop in the windows startup. hosts: localhost connection: local

Re: [ansible-project] Using Cpanel with Ansible

2017-07-06 Thread Kai Stian Olstad
On 05. juli 2017 07:12, Fayad wrote: Upon searching, I could see that the number of processes for users other than root is restricted in cpanel servers. The suggested fix is to disable shell fork bomb protection but it is not secure. Also I'm unable to increase the limit. Currently I'm stuck at

Re: [ansible-project] Ansible parallell playbooks

2017-07-06 Thread Kai Stian Olstad
On 05. juli 2017 16:20, Marcus Karlsson wrote: In my project, where we install Splunk with the help of terraform and ansible, we ran into some "errors" where we had the ansible playbook run on 3 hosts installing a search head in Splunk. I'm a bit confused. Here you describe one playbook with 3

[ansible-project] Specifying ssh key for delegate_to target

2017-07-06 Thread Gin
Hi, I am trying to provision a couple of hosts: [masters] master-1 [nodes] node-1 Each host has an individual private key used to ssh to that particular server. I define ansible_ssh_private_key_file and store private keys on localhost: "./deployment/{{inventory_hostname}}/id_rsa" In this

[ansible-project] Re: Using a windows file share as a source in win_chocolatey.

2017-07-06 Thread 'J Hawkesworth' via Ansible Project
Yeah the module doesn't currently pick up from shares, a private chocolately server is probably the easiest way to fix that. Worth adding that if you want to pick up files from shares for other reasons you should enable kerberos auth delegation so that you can access files from the share as

Re: [ansible-project] Serial: 1 only for one play

2017-07-06 Thread Gintautas Sulskus
Thanks for the response Kai. Now it is working for me as well. I can no longer reproduce the problem. Apologies for the false alarm. Best, Gintas > On 6 Jul 2017, at 14:34, Kai Stian Olstad > wrote: > >> When I set serial:1 for one of the plays in a

Re: [ansible-project] Serial: 1 only for one play

2017-07-06 Thread Kai Stian Olstad
When I set serial:1 for one of the plays in a playbook, the whole playbook is then processed one host at a time. Is this the intended behaviour? I can't confirm this on 2.3.1 Is it possible to apply serial:1 only to one play? E.g. if I have a playbook comprising three plays: p1, p2 (with

Re: [ansible-project] Showing which roles have been run on a machine

2017-07-06 Thread Maciej Delmanowski
Most of my Ansible roles create local Ansible facts, usually to create some internal variables used by the role, or to mark a particular service as installed for conditional checks. Since the Ansible facts are consitently named after the roles that created them, when I check a host to see what

[ansible-project] Showing which roles have been run on a machine

2017-07-06 Thread Gabriel Forster
Is there a standard way to show which roles have been installed on a target machine from that machine? e.g. Ansible control machine installs Apache & MySQL on Remote1 and Nginx & MySQL on Remote2. If I SSH into Remote2, can it tell me that Ansible successfully installed Nginx & MySQL?

Re: [ansible-project] How to use set_fact to set a new host fact based on when conditionals.

2017-07-06 Thread Brian Coca
using set_fact that way requires you to check if those vars are defined, i believe this is a better approach: vars: is_master: "{{ inventory_hostname == master_hostname }}" is_slave: "{{ inventory_hostname == master_hostname }}" then you can just use them direcly in subsequent conditionals:

Re: [ansible-project] Re: handlers and include files with variables in filenames

2017-07-06 Thread Jeff Li
Hope it is clear. The directory structure looks like this playbook.yml vars/main.yml roles/my-roles/handlers/main.yml roles/my-roles/handlers/ocata.yml roles/my-roles/handlers/kilo.yml The* roles/my-roles/handlers/main.yml* looks like this --- - include: "{{ codename }}".yml The variable

[ansible-project] Serial: 1 only for one play

2017-07-06 Thread Gin
Hi, When I set serial:1 for one of the plays in a playbook, the whole playbook is then processed one host at a time. Is this the intended behaviour? Is it possible to apply serial:1 only to one play? E.g. if I have a playbook comprising three plays: p1, p2 (with serial:1) and p3 then p1 and

Re: [ansible-project] Cannot read group_variable from role task - Ansible 2.3.1.0 (works fine with 2.1) -

2017-07-06 Thread Kai Stian Olstad
On 05.07.2017 12:53, Paolo Galizzi wrote: - name: 'Item' debug: var: item with_items: databases - name: 'Item Name' debug: var: item.name with_items: databases In earlier Ansible version "with_items: databases" the databases was seen as a variable, in newer version it's seen

Re: [ansible-project] How to have a space in a variable from a JSON payload returned by uri module

2017-07-06 Thread Kai Stian Olstad
On 04.07.2017 15:05, Rasmus Sjørslev wrote: "json": { "code": 200, "data": { "DNSrecords": "1", "DNSrecursive": "1", "allowRequests": "1", "calculation": { "Broadcast": "192.168.111.255",

[ansible-project] Re: Using a windows file share as a source in win_chocolatey.

2017-07-06 Thread Mike Fennemore
https://chocolatey.org/docs/how-to-set-up-chocolatey-server this might be more usable as the source of packages. On Thursday, July 6, 2017 at 12:54:11 AM UTC+2, Nicholas Reid wrote: > > Hi All, > > Really excited to have discovered this group. Looking forward to being an > active member. > >

Re: [ansible-project] How to use set_fact to set a new host fact based on when conditionals.

2017-07-06 Thread Pshem Kowalczyk
You're most likely after inventory_hostname variable (not ansible_hostname). kind regards Pshem On Thu, 6 Jul 2017 at 18:20 Alex Lien wrote: > Hi all, > > > I am trying to set a new host fact (is_master, is_slave) based on > comparison of a pre-assigned variable and

Re: [ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread Dick Davies
If you have 250 hosts with the same roles applied to them, then yes I'd go with that. You can make the inventories less huge depending on your naming convention by using regexes , e.g. [webservers] www[01:250].example.com Or if you'd rather you can have multiple static inventory files in a

Re: [ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread thomas . lehmann
We have that but it does not answer my question. We still would have *one inventory file* with all hosts for 1000 projects per qa, dev and prod, right? (we have less than 1000 ... is just a forced example) Is it possible to organize ... that OPS can "walk" all hosts also the repository has -

[ansible-project] Re: Using a windows file share as a source in win_chocolatey.

2017-07-06 Thread Mike Fennemore
I don't think that's possible unfortunately with the module as it will attempt to download the files over HTTP. On Thursday, July 6, 2017 at 12:54:11 AM UTC+2, Nicholas Reid wrote: > > Hi All, > > Really excited to have discovered this group. Looking forward to being an > active member. > >

[ansible-project] Re: ansible and windows AD module

2017-07-06 Thread Mike Fennemore
Do you have kerberos delegation? This seems like the classic second hop authentication problem. On Wednesday, July 5, 2017 at 5:53:13 PM UTC+2, anil kumar wrote: > > I am trying to invoke AD commands( I put this into powershellscript) from > ansible server. I am using Kerberos in the ansible

[ansible-project] Re: ansible and windows AD module

2017-07-06 Thread Mike Fennemore
There is currently a Windows Domain user module on PR, perhaps this fits your need https://github.com/ansible/ansible/pull/24075 ? On Wednesday, July 5, 2017 at 5:53:13 PM UTC+2, anil kumar wrote: > > I am trying to invoke AD commands( I put this into powershellscript) from > ansible server. I

Re: [ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread Dick Davies
Try setting up one inventory for QA, another for DEV, and a third for production. You can use the same playbooks with different inventories so it'll keep the environments isolated but you'll get better consistency between each env. On 6 July 2017 at 07:36, wrote: >

[ansible-project] Is splitting of the inventory possible?

2017-07-06 Thread thomas . lehmann
Hi, assume we would have 1000 projects in a big company and an OPS guys tells us to copy every detail for provisioning for qa, dev and prod in one repository. Some told arguments: - just to clone one repository - all Unix machines require a basic setup and therefore the concrete

[ansible-project] How to use set_fact to set a new host fact based on when conditionals.

2017-07-06 Thread Alex Lien
Hi all, I am trying to set a new host fact (is_master, is_slave) based on comparison of a pre-assigned variable and ansible_hostname fact. group_vars/ master_hostname: host1 slave_hostname: host2 Tasks - name: Set master host fact set_fact: is_master: yes when: