--- - name: Setup hosts #become: true #become_user: root #become_method: su hosts: localhost roles: - awx_import-hosts-from-list tasks: - name: debug: var: output # - name: create list # set_fact: # namen: [] # - name: add hosts to list # set_fact: # namen: "{{ aruba_devices | split('\n') }}" # - name: # debug: # var: namen # - name: make host group from survey hosts list # add_host: # hostname: "{{ item }}" # groups: aruba_hosts # ansible_user: sys-switchupgrade # ansible_password: "{{aruba_pass}}" # ansible_network_os: arubanetworks.aos_switch.arubaoss # with_items: "{{namen}}" # - name: Add inventory # awx.awx.inventory: # name: "Aruba hosts (dynamic)" # description: "Hosts imported from playbook" # organization: "Aperam" # state: present # controller_host: https://awx-prd.aperam.internal # controller_oauthtoken: "{{oauth}}" # validate_certs: false # - name: add hosts to inventory # awx.awx.host: # inventory: "Azure Arc enabled hosts (dynamic)" # name: "{{item}}" # state: present # controller_host: https://awx-prd.aperam.internal # controller_oauthtoken: "{{oauth}}" # validate_certs: false # enabled: true # with_items: "{{namen}}"