From cfdfab54adad87c1a3bf58c91aa9ebec019bd7c5 Mon Sep 17 00:00:00 2001 From: Pi Date: Thu, 21 Feb 2019 12:08:09 -0500 Subject: [PATCH] Changed "netflows" role to be consistent with role setup. Also, main.yaml in root is example of how to "call" roles --- ansible.cfg | 0 hosts | 0 main.retry | 1 + main.yaml | 5 ++++ roles/netflows/tasks/main.retry | 0 roles/netflows/tasks/main.yaml | 46 ++++++++++++++++----------------- roles/public/tasks/main.yaml | 0 7 files changed, 28 insertions(+), 24 deletions(-) mode change 100644 => 100755 ansible.cfg mode change 100644 => 100755 hosts create mode 100644 main.retry create mode 100644 main.yaml mode change 100644 => 100755 roles/netflows/tasks/main.retry mode change 100644 => 100755 roles/netflows/tasks/main.yaml mode change 100644 => 100755 roles/public/tasks/main.yaml diff --git a/ansible.cfg b/ansible.cfg old mode 100644 new mode 100755 diff --git a/hosts b/hosts old mode 100644 new mode 100755 diff --git a/main.retry b/main.retry new file mode 100644 index 0000000..a507588 --- /dev/null +++ b/main.retry @@ -0,0 +1 @@ +192.168.50.2 diff --git a/main.yaml b/main.yaml new file mode 100644 index 0000000..2f5ab5a --- /dev/null +++ b/main.yaml @@ -0,0 +1,5 @@ +--- +- hosts: netflows + become: true + roles: + - netflows diff --git a/roles/netflows/tasks/main.retry b/roles/netflows/tasks/main.retry old mode 100644 new mode 100755 diff --git a/roles/netflows/tasks/main.yaml b/roles/netflows/tasks/main.yaml old mode 100644 new mode 100755 index ca26a36..929e5fd --- a/roles/netflows/tasks/main.yaml +++ b/roles/netflows/tasks/main.yaml @@ -1,25 +1,23 @@ --- -- hosts: netflows - tasks: - - name: Install fprobe Package - become: yes - apt: - name: ['fprobe'] - state: present - update_cache: true - tags: install_fprobe - - lineinfile: - path: /etc/default/fprobe - state: present - backrefs: yes - regexp: '^FLOW_COLLECTOR="localhost:555"' - line: 'FLOW_COLLECTOR="192.168.200.247:9995"' - become: true - - name: enable fprobe service and ensure it is not masked - systemd: - name: fprobe - enabled: yes - masked: no - state: restarted - tags: enable_fprobe - become: true +- name: Install fprobe Package + become: yes + apt: + name: ['fprobe'] + state: present + update_cache: true + tags: install_fprobe +- lineinfile: + path: /etc/default/fprobe + state: present + backrefs: yes + regexp: '^FLOW_COLLECTOR="localhost:555"' + line: 'FLOW_COLLECTOR="192.168.200.247:9995"' + become: true +- name: enable fprobe service and ensure it is not masked + systemd: + name: fprobe + enabled: yes + masked: no + state: restarted + tags: enable_fprobe + become: true diff --git a/roles/public/tasks/main.yaml b/roles/public/tasks/main.yaml old mode 100644 new mode 100755