[ansible-project] Run custom code before first task in playbook

2019-04-15 Thread Pavel Martynov
Hi! I use json facts caching and sometimes this files expires (last modified time > than configured fact_caching_timeout). This is a rare problem, but if it arises - I have non-obvious errors in stdout after running my playbook (like "ansible_fqdn is not defined in host_vars", etc). My idea:

Re: [ansible-project] how to modify output

2019-04-15 Thread Dick Visser
Hi On Mon, 15 Apr 2019 at 21:20, federico montaldo wrote: > Hi folks: > > I got the following playbook > > --- > - hosts: win-ravendb-prd > tasks: > - name: Get disk facts > win_disk_facts: > > - name: Ip address > debug: > var: ansible_ip_addresses > > - name:

[ansible-project] Re: Pip install of Ansible on Ubuntu 16.04 results in broken ansible

2019-04-15 Thread Jamz Yaneza
Thank you. This saved me from reinstalling WSL :-) Cheers, Jamz On Monday, December 18, 2017 at 12:36:13 PM UTC-6, Stephen Nesbitt wrote: > > > Well I got it to work with the following command: > > pip install --upgrade --force-reinstall --no-cache-dir ansible > > > Some kind of caching issue? >

[ansible-project] how to modify output

2019-04-15 Thread federico montaldo
Hi folks: I got the following playbook --- - hosts: win-ravendb-prd tasks: - name: Get disk facts win_disk_facts: - name: Ip address debug: var: ansible_ip_addresses - name: Grab first disk set_fact: disk: '{{

[ansible-project] Change a dictionary within a loop

2019-04-15 Thread Spiro Mitsialis
I am trying to edit ansible_facts created by network-engine inside a loop but cannot figure out the syntax. I have a bunch of VLANs as a dict. ``` ok: [burnside-lab-srp.gw.mcgill.ca] => { "ansible_facts": { "cisco_ios": { "vlans": { "1": {

Re: [ansible-project] win_copy azure ansible module not working

2019-04-15 Thread dan
Please clarify a couple questions: 1. You're running the ansible command from a Linux (RedHat, Ubuntu, CentOS, Debian) system, correct? 2. The playbook you're using has these tasks: - name: Copy script from local to remote server win_copy: src: files dest: C:\

[ansible-project] Re: Ansible regex_replace and replace

2019-04-15 Thread Emir Hayric
I am only guessing here but I would assume 'replace' just doesn't use regex syntax to accomplish the same goal. On Monday, April 15, 2019 at 9:00:44 AM UTC-4, ryad9...@gmail.com wrote: > > Hi all, > > I have two task : > > - name: "Utilisation du replace dans un fichier" > set_fact: >

Re: [ansible-project] New User First Issue discrepancy between ansible & tower

2019-04-15 Thread Jon Stanley
Did you set up the private key as a credential in Tower? It would appear that you can't authenticate to the remote host when you run via tower. In the UI, there's an option for what credential to use for the job template. I don't have an instance in front of me to walk you through it exactly, but

[ansible-project] Ansible regex_replace and replace

2019-04-15 Thread ryad9200000
Hi all, I have two task : - name: "Utilisation du replace dans un fichier" set_fact: mon_fichier: "{{ lookup('file', '/home/ansible/file.txt') | replace('\n', ' ') }}" and - name: "Utilisation du regex_replace dans un fichier" set_fact: new_file: "{{ lookup('file',