[ansible-project] Re: PowerShell script help

2018-10-18 Thread Jordan Borean
That says around line 232 of your PowerShell script is missing a brace. This is a syntax issue in your script and not an issue in Ansible. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emai

[ansible-project] running bash command in ansible on centos 7 leads to /dev/null permission denied problem

2018-10-18 Thread lwsanty
hi guys! has anyone bumped into the similar issue before? https://github.com/ansible/ansible/issues/47305 -- 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 ansi

[ansible-project] Re: PowerShell script help

2018-10-18 Thread Dimitri Yioulos
Thanks, Jordan. I've already tried that, and here's the return: fatal: [kcrook10]: FAILED! => {"changed": true, "cmd": "powershell.exe -ExecutionPolicy Bypass -File C:\\temp\\command_update.ps1 -ConsoleTitle \"Dell Command | Update\"", "delta": "0:00:00.546000", "end": "2018-10-18 08:24:45.319

[ansible-project] Re: PowerShell script help

2018-10-18 Thread Jordan Borean
Use win_command to call the script like you would locally. - win_command: powershell.exe -ExecutionPolicy Bypass -File C:\path\to\ script.ps1 -ConsoleTitle "Dell Command | Update" Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Project" grou

[ansible-project] Re: include_role with passed variable defined by template fails

2018-10-18 Thread Dmitriy Panteleyev
Finally tracked the issue down to my misunderstanding of how lookup() works. Answer here: https://groups.google.com/forum/#!topic/ansible-project/McPi-i-90yU On Monday, October 15, 2018 at 10:06:00 PM UTC-6, Dmitriy Panteleyev wrote: > > I'm a bit confused how variables are defined when using `

[ansible-project] Re: When are file lookups performed? How to store lookup result in a variable?

2018-10-18 Thread Dmitriy Panteleyev
Thank you for clearing it up! On Thursday, October 18, 2018 at 11:54:12 AM UTC-6, Dmitriy Panteleyev wrote: > > I was under the impression that if I define a variable with a `lookup` > function, it would store the results of the lookup. And then when I used > that variable, it would spit out

Re: [ansible-project] When are file lookups performed? How to store lookup result in a variable?

2018-10-18 Thread Kai Stian Olstad
On Thursday, 18 October 2018 19.54.12 CEST Dmitriy Panteleyev wrote: > I was under the impression that if I define a variable with a `lookup` > function, it would store the results of the lookup. And then when I used > that variable, it would spit out the results of the lookup. > > However, fro

Re: [ansible-project] Handlers called but not working

2018-10-18 Thread Leam Hall
On Thu, Oct 18, 2018 at 11:56 AM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On Thursday, 18 October 2018 17.47.02 CEST Leam Hall wrote: > > Yes, with the note that I actually fixed the handler names to match. > > > > # tasks/main.yml > > > > - include: install_httpd.yml > > > > -

[ansible-project] Ansible Playbook fails with syntax error

2018-10-18 Thread Tony Esposito
Hello, I am new to Ansible and would like some feedback, please. I am running Ansible 2.5.0 and using AWX. Having some issues running this playbook. - hosts: "{{ target1 }}" gather_facts: false become: true become_user: webuser roles: - r10web/git_pull - hosts: "{{ target1 }}"

[ansible-project] When are file lookups performed? How to store lookup result in a variable?

2018-10-18 Thread Dmitriy Panteleyev
I was under the impression that if I define a variable with a `lookup` function, it would store the results of the lookup. And then when I used that variable, it would spit out the results of the lookup. However, from running a bunch of different test cases that Ansible performs the lookup eve

Re: [ansible-project] getting error when test ping on router ios

2018-10-18 Thread bill paxton
I don't believe the ping module will work with any device that cannot run python locally. https://docs.ansible.com/ansible/2.5/modules/ping_module.html -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

Re: [ansible-project] Handlers called but not working

2018-10-18 Thread Kai Stian Olstad
On Thursday, 18 October 2018 17.47.02 CEST Leam Hall wrote: > Yes, with the note that I actually fixed the handler names to match. > > # tasks/main.yml > > - include: install_httpd.yml > > - include: cat1.yml > when: apache_cat1 | bool > notify: restart_httpd include has only ok and failed

[ansible-project] Managing Realm Permits Based on Satellite Parameters

2018-10-18 Thread Jeremy Winder
I am running RHEL 7.5, Satellite 6.3, Ansible 2.7.0, and Ansible AWX 2.0.1. I am in the process of developing playbooks to handle our server provisioning. As part of the provisioning process, we are using sssd and realmd, to join the servers to our Active Directory tree. The next step in the pr

Re: [ansible-project] Handlers called but not working

2018-10-18 Thread Leam Hall
On Thu, Oct 18, 2018 at 11:37 AM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On Thursday, 18 October 2018 16.01.55 CEST Leam Hall wrote: > > In the ansible output it says: > > > > META: ran handlers > > This indicates that it run all the handler that was notified so that mean >

Re: [ansible-project] Handlers called but not working

2018-10-18 Thread Kai Stian Olstad
On Thursday, 18 October 2018 16.01.55 CEST Leam Hall wrote: > In the ansible output it says: > > META: ran handlers This indicates that it run all the handler that was notified so that mean not necessarily all the handlers. > For this role handlers/main.yml is: > > - name: restart_and_enab

[ansible-project] block rescue notifications

2018-10-18 Thread KSS
Hi, I have a playbook that attempts to notify via slack of hosts that were successful and those that failed. Below is a simply playbook showing what I'm trying to achieve using debug. Ansible version: 2.6.5 Playbook --- - hosts: all tasks: -

Re: [ansible-project] removing blank lines after all lines start with specific string

2018-10-18 Thread Dick Visser
- replace: path: my_file regexp: '(XXX1.*)$\s+' replace: '\1' On Thu, 18 Oct 2018 at 09:47, Shlomit Afgin wrote: > > > HI, > Is there any way to remove from a file, all blank lines that exist after > line start with specific string? > > for example: > > Remove all

[ansible-project] Block rescue notification of failed hosts

2018-10-18 Thread KSS
Hi, I have a playbook that attempts to notify via slack of hosts that were successful and those that failed. Below is a simply playbook showing what I'm trying to achieve using debug. Ansible version: 2.6.5 Playbook --- - hosts: all tasks: -

Re: [ansible-project] Reinstall package if config dir is missing or different?

2018-10-18 Thread S C Rigler
Assuming you're using RPM, files that are marked "config" files in the package will not be overwritten by package upgrades (that's how you end up with ".rpmnew" files). But if you have missing files you can file them by looking at the output of "rpm -V". Then think of some creative way to trigger

[ansible-project] Reinstall package if config dir is missing or different?

2018-10-18 Thread Mauricio Tavares
As you know some packages install their config files/dir during the normal package installation (the first examples that popped in my mind are postfix, bind, and apache). I understand that if the configuration file I am editing using ansible is different than the one I providing (as file or t

[ansible-project] Handlers called but not working

2018-10-18 Thread Leam Hall
In the ansible output it says: META: ran handlers For this role handlers/main.yml is: - name: restart_and_enable_httpd service: name: httpd state:restarted enabled: true This is Ansible 2.6 on RHEL 6. httpd is installed earlier in the process but at the end it is not

[ansible-project] PowerShell script help

2018-10-18 Thread Dimitri Yioulos
Hi, all. I've created a playbook to run a PowerShell script. The script is already copied to the target system (but also exists on the Ansible server). It must be run with the following argument: -ConsoleTitle "Dell Command | Update" I've tried every module I can think of, with every way to

Re: [ansible-project] getting error when test ping on router ios

2018-10-18 Thread Oriol Tauleria
Hello Aris, you are trying to define the hosts file like a ini file (with name=value and group:vars) but you are trying to read like if it's in yaml format. More information about how to describe in yaml/ini format here => https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html T

[ansible-project] Re: Using vmware_guest_snapshot with case insensitive VM names

2018-10-18 Thread KSS
I've just found the UUID is avaible in ansible_product_uuid (or facter fact as 'uuid'). So easy enough if we gather facts from the machine first. On Wednesday, 17 October 2018 17:18:10 UTC+1, KSS wrote: > > Hi, > > I'm looking at switching to using the vmware_guest_snapshot module to take > sna

Re: [ansible-project] Re: passing -y flag with yum

2018-10-18 Thread Jonathan Lozada De La Matta
that's why I asked what state were you using. Can you di a run with extra verbise? On Thu, Oct 18, 2018 at 4:54 AM wrote: > You can use :- > > *- name: install the latest version of > yum: > name: > state: **latest* > OR > > *- name: install one specific version of > yum: > na

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Karl Auer
Sorry, I wasn't suggesting you use a sequence! :-) That was just to illustrate the effect in a small test program. I was just saying that to get the template re-evaluated you need to use a loop control that changes. Which you have achieved with a check of stdout. Regards, K. On Thu, Oct 18, 2018

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
четверг, 18 октября 2018 г., 11:34:25 UTC+3 пользователь Karl Auer написал: > > Try this: > > # Test random filter > - hosts: localhost > > tasks: > - name: Test random > set_fact: > rand_result: "{{ 5 |random }}" > with_sequence: count=10 > > Basically the change of item

[ansible-project] Re: passing -y flag with yum

2018-10-18 Thread aakanksha . jain
You can use :- *- name: install the latest version of yum: name: state: **latest* OR *- name: install one specific version of yum: name: -2.9.amzn1 state: present* On Thursday, October 18, 2018 at 7:06:50 AM UTC+5:30, Chad Fay wrote: > > I'm new at this, I'm trying to fig

[ansible-project] Re: removing blank lines after all lines start with specific string

2018-10-18 Thread aakanksha . jain
you can write shell script for that and put that code in playbook. On Thursday, October 18, 2018 at 1:17:03 PM UTC+5:30, Shlomit Afgin wrote: > > > HI, > Is there any way to remove from a file, all blank lines that exist after > line start with specific string? > > for example: > > Remove all b

[ansible-project] Re: Want be able to source ~/.profile

2018-10-18 Thread aakanksha . jain
I think this code is useful for you ,try it. *- name: "create java.sh file with permissions." file:path: "/etc/profile.d/java.sh"state: touchmode: 0755- name: "create java.sh file with content" copy:dest: "/etc/profile.d/java.sh" content: | export J

[ansible-project] Re: open command line installer by playbook

2018-10-18 Thread aakanksha . jain
in shell i have to write ./install command and it open console installer for software, but when I perform same activity by Ansible it work in background with default value. On Saturday, October 13, 2018 at 10:24:29 PM UTC+5:30, Varun Chopra wrote: > > If you can do it through a shell script, you

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Karl Auer
Try this: # Test random filter - hosts: localhost tasks: - name: Test random set_fact: rand_result: "{{ 5 |random }}" with_sequence: count=10 Basically the change of item forces a re-evaluation, even though nothing is changing inside the loop. However: You may still h

Re: [ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
Actually, example without lookup at all: - name: Test random set_fact: rand_result: "{{ 5 | random }}" until: rand_result == 'NEVER' retries: 10 delay: 1 If I run ansible in verbose mode I see that on all iterations rand_result var have the same value, so jinja template evaluated once.

[ansible-project] removing blank lines after all lines start with specific string

2018-10-18 Thread Shlomit Afgin
HI, Is there any way to remove from a file, all blank lines that exist after line start with specific string? for example: Remove all blank lines after lines start with XXX1 XXX1bla bla bla hjshfgdfg gdfsgdsgdf gsdfgd XXX1 blu bluu blu dfjgljfd gfdgds will be: XXX1bla bla bla hjshfgdfg

Re: [ansible-project] passing -y flag with yum

2018-10-18 Thread Jordan Borean
That sounds like a bug, how do you know for sure it's because it's not passing -y or not some other issue. Looking at the code '-y' is part of the base arguments that are always set so I don't think this is your issue https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/packaging/os

[ansible-project] How to wait for DNS record?

2018-10-18 Thread Pavel Martynov
Hi! I want to wait for some DNS record registered in DNS server. For example, A record. So I try to use this task: - name: Wait DNS A record host.example.com registered set_fact: lookup_result: "{{ lookup('dig', 'host.example.com.') }}" until: lookup_result != 'NXDOMAIN' retries: 20