Re: [ansible-project] Re: Help with playbooks

2017-09-21 Thread Kai Stian Olstad
On 22. sep. 2017 00:59, Joli Martinez wrote: On Thursday, September 21, 2017 at 3:58:05 PM UTC-4, Bob Tanner wrote: This is what I do. https://gist.github.com/basictheprogram/29a093366b2bdc9d15a07312c8d29587 OK, but what is wrong with my playbook? Your "- name: Add Unix Admins users"

Re: [ansible-project] regexp help.....

2017-09-21 Thread Kai Stian Olstad
On 22. sep. 2017 01:08, John Harmon wrote: This works under a regexp tester, but fails under ansible. I don't know how to correct it. You need to use a Python based one, since Ansible is using Python re. Basically, it finds the lines starting with passwd or group, looks in the lines for

Re: [ansible-project] yum module localinstall many rpms from directory possible?

2017-09-21 Thread daddyocruzer
Success Some Learning Assumptions: === So, this section I think I kinda get - it sets up 'r' to iterate through the 'patterns' matches found beneath 'paths'. - yum: name: "{{ r.files | map(attribute='path') | list }}" This must iterate through

[ansible-project] regexp help.....

2017-09-21 Thread John Harmon
This works under a regexp tester, but fails under ansible. I don't know how to correct it. Basically, it finds the lines starting with passwd or group, looks in the lines for sss, and appends if it isn't found. - name: Update nsswitch.conf replace: path: /etc/nsswitch.conf regexp:

[ansible-project] Re: Help with playbooks

2017-09-21 Thread Joli Martinez
On Thursday, September 21, 2017 at 3:58:05 PM UTC-4, Bob Tanner wrote: > > This is what I do. > > https://gist.github.com/basictheprogram/29a093366b2bdc9d15a07312c8d29587 > > OK, but what is wrong with my playbook? thanks -- You received this message because you are subscribed to the Google

[ansible-project] Re: specifying targets for win_psexec module?

2017-09-21 Thread Jordan Borean
You can have multiple plays in a playbook so your playbook could look something like this. - name: setup PS requirements on all hosts hosts: firsthost tasks: - name: install psexec win_chocolatey: name: sysinternal state: present - name: setup PS with psexec

[ansible-project] Re: Targeting Windows & Linux Machines from One Role

2017-09-21 Thread Jordan Borean
In your main.yml put in include_tasks: windows.yml when the host is Windows and include_tasks: unix.yml when it is not. You can use the gathered facts to do this or you can have a variable that can be set when running on Windows by the end user. Personally I think you should still split the

[ansible-project] Targeting Windows & Linux Machines from One Role

2017-09-21 Thread Heather Luna
I currently have a role that I am trying to tailor to install a splunk forwarder on both Linux and Windows machines but I'm a little confused as to how I should be telling the main.yml to yes go target these other two tasks splunklinux.yml if it's a RedHat Linux distribution or go to

[ansible-project] Re: Trying to push locally stored .pub keys to the "authorized_keys" on a remote host

2017-09-21 Thread Dave Florek
I see. I'm not thinking abstractly enough. Thanks! On Thursday, September 21, 2017 at 4:47:49 PM UTC-4, Dave Florek wrote: > > Hi, > > I'm looking at the Ansible 'authorized_key' module and I'm unable to > figure out whether it's possible to push locally stored .pub keys to the >

[ansible-project] gconftool2 module odd behaviour

2017-09-21 Thread William Muriithi
Hello, I am wondering if anyone have used the above before. I have a task that I was initially using command module but today came across above module and decided to improve that task by using a module. The task is to prevent desktop users using auto login as its insecure. After starting to

Re: [ansible-project] Trying to push locally stored .pub keys to the "authorized_keys" on a remote host

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 22:47, Dave Florek wrote: Hi, I'm looking at the Ansible 'authorized_key' module and I'm unable to figure out whether it's possible to push locally stored .pub keys to the authorized_keys file on a remote host. I don't want to go the route of uploading .pub keys to a webserver

Re: [ansible-project] Trying to push locally stored .pub keys to the "authorized_keys" on a remote host

2017-09-21 Thread Matt Martz
The docs for the authorized_key module has an example that covers this exact case: http://docs.ansible.com/ansible/latest/authorized_key_module.html - name: Set authorized key took from file authorized_key: user: charlie state: present key: "{{ lookup('file',

[ansible-project] Trying to push locally stored .pub keys to the "authorized_keys" on a remote host

2017-09-21 Thread Dave Florek
Hi, I'm looking at the Ansible 'authorized_key' module and I'm unable to figure out whether it's possible to push locally stored .pub keys to the authorized_keys file on a remote host. I don't want to go the route of uploading .pub keys to a webserver and use URL links to transfer the keys to

Re: [ansible-project] expected , but found '-'

2017-09-21 Thread Matt Martz
I didn't go look at the authors page. Based on what you provided, the first play is missing `tasks:` On Thu, Sep 21, 2017 at 3:41 PM, Bob Tanner wrote: > > > On Thursday, September 21, 2017 at 3:11:41 PM UTC-5, Matt Martz wrote: >> >> You seem to be missing `tasks:`

Re: [ansible-project] expected , but found '-'

2017-09-21 Thread Bob Tanner
On Thursday, September 21, 2017 at 3:11:41 PM UTC-5, Matt Martz wrote: > > You seem to be missing `tasks:` in your first play. As such YAML wasn't > expecting you to start a list there. > > So the original authors Listing 11 is wrong? -- You received this message because you are

Re: [ansible-project] expected , but found '-'

2017-09-21 Thread Matt Martz
You seem to be missing `tasks:` in your first play. As such YAML wasn't expecting you to start a list there. On Thu, Sep 21, 2017 at 3:03 PM, Bob Tanner wrote: > I'm following this post, https://www.ibm.com/developerworks/cloud/library/ >

[ansible-project] Re: How to change this regexp to multiline?

2017-09-21 Thread John Harmon
I had seen the doc before, but I didn't notice the definition under the regexp before. Thank you. On Thursday, September 21, 2017 at 1:51:31 PM UTC-6, John Harmon wrote: > > I need to set the multiline flag on this, but don't know how to. Can > anyone help? > > regexp:

Re: [ansible-project] Re: How to change this regexp to multiline?

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 22:01, John Harmon wrote: Just a thought I am using this with the replace module does it already assume multiline (as lineinfile does not)? Have you read the docs under regexp? https://docs.ansible.com/ansible/latest/replace_module.html -- Kai Stian Olstad -- You

[ansible-project] expected , but found '-'

2017-09-21 Thread Bob Tanner
I'm following this post, https://www.ibm.com/developerworks/cloud/library/cl-provision-docker-containers-ansible/index.html, and Listing 11 --- - name: initialize provisioning hosts: docker - name: start up target container docker: image: python:2.7 name: lab

[ansible-project] Re: How to change this regexp to multiline?

2017-09-21 Thread John Harmon
Just a thought I am using this with the replace module does it already assume multiline (as lineinfile does not)? On Thursday, September 21, 2017 at 1:51:31 PM UTC-6, John Harmon wrote: > > I need to set the multiline flag on this, but don't know how to. Can > anyone help? > > regexp:

[ansible-project] Re: Help with playbooks

2017-09-21 Thread Bob Tanner
This is what I do. https://gist.github.com/basictheprogram/29a093366b2bdc9d15a07312c8d29587 -- 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] Help with playbooks

2017-09-21 Thread Joli Martinez
Hello, I am new to Ansible. I am creating my first playbook. I would like to add a useraccount to all my hosts, make the user a sudo user and have them sudo without a password. Also remove root logins. for some reason it is not working and seem to figure out why. I keep getting the error.

[ansible-project] How to change this regexp to multiline?

2017-09-21 Thread John Harmon
I need to set the multiline flag on this, but don't know how to. Can anyone help? regexp: '^(?:passwd):\s+(?:(?!sss).)+$' -- 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,

Re: [ansible-project] yum module localinstall many rpms from directory possible?

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 20:51, daddyocruzer wrote: Hello tasks: - name: yum local install yum: name=/sharedfilesystem/*.rpm state=present Our team has several environments that lead up to our production environment, so patches must be applied and tested in one environment at a time (as

Re: [ansible-project] yum module localinstall many rpms from directory possible?

2017-09-21 Thread Dick Davies
That's fine, look at with_items to get it all done in a single yum transaction. On 21 September 2017 at 19:51, daddyocruzer wrote: > Hello > > tasks: > - name: yum local install > yum: name=/sharedfilesystem/*.rpm state=present > > Our team has several

Re: [ansible-project] Re: Conflicting versions of wrapped roles in an Ansible project

2017-09-21 Thread Brian Coca
proposed .. developed .. remains to be seen. -- -- 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

Re: [ansible-project] Question about force handlers

2017-09-21 Thread Anfield
Ok nevermind. This works now. I forgot to add become: yes to the main file in the last try. The task now calls the handler, despite the failure in the 2nd task. So with the tasks/main.yml tasks/main.yml - name: Install nginx yum: name: nginx state: installed register:

Re: [ansible-project] Problem referencing variables

2017-09-21 Thread Dave Florek
Thanks Kai On Thu, Sep 21, 2017 at 1:39 PM, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 21. sep. 2017 17:20, Dave Florek wrote: > >> Hi Branko, >> >> Thanks for the response. I only posted what was on line 20. >> > > It's recommended to show everything, you'll get help a lot

Re: [ansible-project] Question about force handlers

2017-09-21 Thread Anfield
So I switched around the tasks in the task/main.yml to get this, and the notify still doesnt happen tasks/main.yml - name: Install nginx yum: name: nginx state: installed register: nginx_installed notify: - restart nginx - name: Run a command that fails shell: /bin/false

Re: [ansible-project] Re: Conflicting versions of wrapped roles in an Ansible project

2017-09-21 Thread jhammerman via Ansible Project
Yes great info. Thanks Brian. +1 for developing this feature! Joe On Monday, September 18, 2017 at 6:55:26 PM UTC-4, Brian Coca wrote: > > Not sure if this would help your case > https://github.com/ansible/proposals/issues/23 > > > > -- > -- > Brian Coca > -- You received this

[ansible-project] yum module localinstall many rpms from directory possible?

2017-09-21 Thread daddyocruzer
Hello tasks: - name: yum local install yum: name=/sharedfilesystem/*.rpm state=present Our team has several environments that lead up to our production environment, so patches must be applied and tested in one environment at a time (as they exist at a specific version 'point-in-time')

Re: [ansible-project] replace module: Invalid group reference

2017-09-21 Thread John Harmon
Perfect. Thanks Matt! I am really horrible at regexp. I totally missed grouping it. I tested it and it works. Thanks again. On Thursday, September 21, 2017 at 12:18:20 PM UTC-6, Matt Martz wrote: > > You haven't actually created a match group in your regex. I assume you > want something

Re: [ansible-project] replace module: Invalid group reference

2017-09-21 Thread Matt Martz
You haven't actually created a match group in your regex. I assume you want something like ^(group.*) or something. The () create the match group. On Thu, Sep 21, 2017 at 1:13 PM, John Harmon wrote: > I am trying to append to some lines within the nsswitch file to

Re: [ansible-project] Re: Template module. MODE all wrong when using loop

2017-09-21 Thread John Harmon
Actually, that brings up a follow-up question. why doesn't it treat it that way in the first example, when I don't use a loop? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

Re: [ansible-project] Re: Template module. MODE all wrong when using loop

2017-09-21 Thread John Harmon
Perfect! Thank you Kai Stian Olstad On Thursday, September 21, 2017 at 12:13:29 PM UTC-6, Kai Stian Olstad wrote: > > On 21. sep. 2017 20:03, John Harmon wrote: > > If I do the following it works (putting quotes around the mode). Can > > anybody explain to my why? > > Yes, Ansible

[ansible-project] replace module: Invalid group reference

2017-09-21 Thread John Harmon
I am trying to append to some lines within the nsswitch file to setup sssd. I am trying this with the loop below, but I have never used backrefs before. I am unsure if I am doing it correctly. I get an error about an invalid group reference. I wonder if my regexp is wrong? Code - name:

Re: [ansible-project] Re: Template module. MODE all wrong when using loop

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 20:03, John Harmon wrote: If I do the following it works (putting quotes around the mode). Can anybody explain to my why? Yes, Ansible interprets number starting with 0 as octal number. 0644 = 6*8^2 + 4*8^1 + 4*8^0 = 420 decimal. So to avoid this conversion you need to use

[ansible-project] Re: Template module. MODE all wrong when using loop

2017-09-21 Thread John Harmon
If I do the following it works (putting quotes around the mode). Can anybody explain to my why? > > - name: test > template: > src: "files/sssd.conf" > dest: "/etc/sssd/sssd.conf" > mode: 0600 > group: root > owner: root > > - name: Add/Update required files > template:

[ansible-project] Template module. MODE all wrong when using loop

2017-09-21 Thread John Harmon
When using the template module within a loop, my mode comes out all weird/wrong. When using stand-alone it works: - name: test template: src: "files/sssd.conf" dest: "/etc/sssd/sssd.conf" mode: 0600 group: root owner: root - name: Add/Update required files template:

[ansible-project] Re: Ansible report - Web interface

2017-09-21 Thread manu
Thanks, Initially, I developed my interface to connect it with another product I use; which was more difficult with ara. (There is a (still in development) version of ansible-report with PostgreSQL storage and user management) On Thursday, 21 September 2017 05:51:25 UTC-4, Mike Fennemore

Re: [ansible-project] Question about force handlers

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 16:11, Anfield wrote: Testing out the force handlers parameter in a role and it is not working for me.The first tasks fails, so I though the force handlers would force the second one to get trigger anyway As I understand the documentation it will only run the handlers that has

Re: [ansible-project] Problem referencing variables

2017-09-21 Thread Kai Stian Olstad
On 21. sep. 2017 17:20, Dave Florek wrote: Hi Branko, Thanks for the response. I only posted what was on line 20. It's recommended to show everything, you'll get help a lot faster that way because the problem can be anywhere as you can see by my comments bellow. Code: --- - hosts: all

[ansible-project] Ansible Snapshot size for Vmware Guest

2017-09-21 Thread Hemant Kulkarni
Hello All, I am using vmware_guest_snapshot: module to take snapshot of VMS , I observed that snapshot Process is very fast and snapshot size is very less .. if I login to vmware console & take snapshot it will take 11 min and size of that snap is around 800 MB . on other side ansible play

[ansible-project] Using yum module to install/update to defined version of a package-X.

2017-09-21 Thread Rui Goncalves
Hi all. I'd like to install or update a package specifying the major.minor version. I.e, upgrade only if there's a bugfix package available. I've tried using state=*latest* and *present*, but does not work as I expected. Using: yum: name=nginx-debuginfo-1.6* state=latest > Suffix "-1.6*" is

[ansible-project] ec2_win_password unable to parse key file

2017-09-21 Thread Ryan Howe
Hello, I'm trying to use the ec2_win_password module to retrieve the default Administrator password for an EC2 instance. I had a play working and then upgraded to Ansible 2.4. I added the cryptography module as the notes indicate. My play continually fails returning a message that it can't

[ansible-project] specifying targets for win_psexec module?

2017-09-21 Thread 'Steve Kersley' via Ansible Project
As I understand it, the win_psexec action connects to a Windows host via winrm and then uses that to run commands on a second Windows host via psexec? My question is how to write a playbook such that the first (proxy) host is always constant, but the second hosts are the ones defined in the

Re: [ansible-project] Problem referencing variables

2017-09-21 Thread Dave Florek
Hi Branko, Thanks for the response. I only posted what was on line 20. I'm noticing a general issue where if I double-bracket variables, even as Ansible instructs me, I still receive error messages. I'm using Ansible version 2.1.1.0. Code: *---* *- hosts: all* * become: yes* * vars_prompt:*

[ansible-project] Question about force handlers

2017-09-21 Thread Anfield
Testing out the force handlers parameter in a role and it is not working for me.The first tasks fails, so I though the force handlers would force the second one to get trigger anyway nginx.yml --- - hosts: appservers force_handlers: True roles: - { role: nginx, when: "ansible_os_family

[ansible-project] Problem with include_tasks

2017-09-21 Thread Jürgen Haas
I have a lot of includes in my roles and I replaced them with include_tasks which seems to be working fine. Just for one instance there is a problem. The original task in that role looks like this: ``` - name: "Install Drupal" include: install.yml with_items: '{{ drupal_settings }}' ```

Re: [ansible-project] Problem referencing variables

2017-09-21 Thread Branko Majic
On Tue, 19 Sep 2017 10:13:37 -0700 (PDT) Dave Florek wrote: > *Error message I get at execution:* > > ERROR! Syntax Error while loading YAML. > > > The error appears to have been in > '/opt/ansible/setup_scripts/create_user.yml': line 20, column 1, but > may be

Re: [ansible-project] Re: How can Integrate Ansible Tower with Active Directory

2017-09-21 Thread Soniya panwar
can you please share what exactly error you are getting and where you got stuck? Thanks On Thursday, September 21, 2017 at 12:32:30 PM UTC+5:30, Nuwan Vithanage wrote: > > Hi Soniya , > > Thank you for the information I have followed the same link but still > struck with it > > > > > On Thu,

[ansible-project] Re: How to update or add string at the end of a line

2017-09-21 Thread Soniya panwar
Hello >>Below is what I need to achieve i think you forgot to give your requirements. if you can provide what exactly you need it will be easy to answer. you can use blockinfile module if you want to insert/update/remove a block of lines in a file, for more understanding please follow this

[ansible-project] Re: Ansible report - Web interface

2017-09-21 Thread Mike Fennemore
Looks good, have you seen this https://github.com/openstack/ara ? On Wednesday, September 20, 2017 at 3:14:16 PM UTC+2, ma...@unixdev.ca wrote: > > Hi, > > I developed and now share an Ansible report in Python (flask) > > The python script create a personal temporary tiny web server where you >

[ansible-project] Re: ansible

2017-09-21 Thread Soniya panwar
Hello it is failing because of the password, to solve this problem please follow these steps: Add these lines in ansible.cfg file: [defaults] sudo_user = root ask_pass = True After saving this file export ask sudo password export ANSIBLE_ASK_SUDO_PASS=true On

[ansible-project] Re: help with a cloudwatchevent_rule problem

2017-09-21 Thread Derek Gibson
The below error was on 2.3.2.0 I just upgraded to 2.4.0.0 and got the following - The error was: Unknown parameter in Targets[0]: "EcsParameters", must be one of: Id, Arn, Input, InputPath So is this maybe a bugged/broken feature? On Thursday, 21 September 2017 10:05:59 UTC+2, Derek Gibson

[ansible-project] help with a cloudwatchevent_rule problem

2017-09-21 Thread Derek Gibson
I want to be able to update ecs scheduled tasks via ansible, using - cloudwatchevent_rule: name: ansitest schedule_expression: "cron(0 20 * * ? *)" description: test from ansible targets: - id: ansitest arn:

Re: [ansible-project] Re: How can Integrate Ansible Tower with Active Directory

2017-09-21 Thread Nuwan Vithanage
Hi Soniya , Thank you for the information I have followed the same link but still struck with it On Thu, Sep 21, 2017 at 12:11 PM, Soniya panwar wrote: > > Hello > > To integrate Ansible tower version 3.1.5 with LDAP you can follow this > link: >

[ansible-project] Re: How can Integrate Ansible Tower with Active Directory

2017-09-21 Thread Soniya panwar
Hello To integrate Ansible tower version 3.1.5 with LDAP you can follow this link: http://docs.ansible.com/ansible-tower/latest/html/administration/ldap_auth.html On Tuesday, September 19, 2017 at 12:03:21 PM UTC+5:30, Nuwan Vithanage wrote: > > *HOW CAN I INTEGRATING ANSIBLE TOWER WITH LDAP

[ansible-project] Re: Aggregates in network modules

2017-09-21 Thread Ganesh Nalawade
ios_logging module does not support purge as of now, as you figured it out this is a feature under development. Also, the way currently aggregate works is subject to change in future as there are ongoing discussions to implement this using Ansible loops (something similar to with_*). Stay