Execution
Date 25 Feb 2026 14:11:16 +0000
Duration 00:00:20.00
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.13
ara 1.7.4 / 1.7.4
Python 3.10.10
Summary
36 Hosts
4 Tasks
69 Results
2 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/create_cvepatrol_inventory.yaml

---
- name: Delete file if exists and create header
  hosts: localhost
  gather_facts: false
  vars:
    inv_file: "/home/ssh-gateway/ansible/kuly/{{ out_file }}"
  tasks:
    - name: Delete inventory file if it exists
      ansible.builtin.file:
        path: "{{ inv_file }}"
        state: absent
      run_once: true
    - name: Create file and header
      ansible.builtin.lineinfile:
        path: "{{ inv_file }}"
        line: "[cvepatrol]\n"
        create: true
        mode: '0644'
      run_once: true

- name: Generate hostname list
  hosts: all
  gather_facts: false
  vars:
    inv_file: "/home/ssh-gateway/ansible/kuly/{{ out_file }}"
  tasks:
    - name: Get plesk info
      plesk_info:
      register: plsk
    - name: Make CL inventory
      when: plsk.plesk found
      ansible.builtin.lineinfile:
        path: "{{ inv_file }}"
        line: "{{ inventory_hostname }}"
        insertafter: "[cvepatrol]"
      delegate_to: localhost

- name: Add footer
  hosts: localhost
  gather_facts: false
  vars:
    inv_file: "/home/ssh-gateway/ansible/kuly/{{ out_file }}"
  tasks:
    - name: Add vars
      ansible.builtin.lineinfile:
        path: "{{ inv_file }}"
        line: |
          [cvepatrol:vars]
          user=root
          port=2233
          sh_key = /home/cvepatrol/.ssh/cve_patrol_scanner
        insertafter: EOF
      run_once: true
      delegate_to: localhost