#ansible - February 2020

ansibleArchived
10 messages

Discussions related to ansible configuration management

February 2020
Santiago Campuzano
Santiago Campuzanoover 6 years ago
Morning to everyone... !
Santiago Campuzano
Santiago Campuzanoover 6 years ago
I have this simple playbook:
Santiago Campuzano
Santiago Campuzanoover 6 years ago
---
- hosts: all
  vars:
    dest: /tmp/distro.csv
  tasks:
    - copy:
        content: ''
        dest: "{{ dest }}"
      run_once: yes
      delegate_to: localhost
    - lineinfile:
        dest: "{{ dest }}"
        line: '{{ inventory_hostname }},{{ ansible_distribution }},{{ ansible_distribution_major_version }},{{ ansible_distribution_version }},{{ ansible_distribution_release }}'
      delegate_to: localhost
      run_once: true
Santiago Campuzano
Santiago Campuzanoover 6 years ago
Which is intended to get OS and platform info about every single node on the inventory, and write the /tmp/distro.csv
Santiago Campuzano
Santiago Campuzanoover 6 years ago
The playbook seems to run fine against all hosts:
Santiago Campuzano
Santiago Campuzanoover 6 years ago
ok: [172.30.104.180]
ok: [172.30.104.176]
ok: [172.30.32.241]
ok: [172.30.33.129]
ok: [172.30.34.236]
ok: [172.30.35.212]
ok: [172.30.35.194]
ok: [172.30.33.97
Santiago Campuzano
Santiago Campuzanoover 6 years ago
But the file is not written
Santiago Campuzano
Santiago Campuzanoover 6 years ago
Any idea what could be wrong with it ?
Santiago Campuzano
Santiago Campuzanoover 6 years ago
I would really appreciate any help 🙂
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
@UUB28NLDS help keep tabs! 😉