skip to Main Content

Installed Ansible AWX on CentOS 7 without docker. Want to add remote linux hosts(without password) to AWX and run play books and get the results. How to do it? Can any one help. One or two hosts I can add it in web page. How to add 100 remote hosts to AWX. Is there any AWX back end scripting is there to add N number of remote hosts to AWX? Thanks.

2

Answers


  1. Create inventory file in git. Add it to projects in AWX. Create inventory with source as inventory project in AWX.
    Your ssh keys will have to be stored in awx credentials.

    Login or Signup to reply.
    1. Create inventory with credentials via web interface.

      1. Sign in hosts with AWX via ssh.
        ssh user@hostname
        
      2. Sign in container awx_tasks
        docker exec -it awx_task sh
        
    2. Create or copy file with hosts ip/hostname

      # cat hosts.ini
      10.0.0.1
      10.0.0.2
      #
      
    3. Add multiple hosts from file to inventory

      awx-manage inventory_import 
        --inventory-name my-inventory 
        --source hosts.ini
      

    Worked in my case, AWX 17.0.1

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search