Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #!/bin/bash
  2. cat > /root/tower_setup_conf.yml <<'EOF'
  3. admin_password: redhat01
  4. database: internal
  5. munin_password: redhat01
  6. pg_password: redhat01
  7. primary_machine: localhost
  8. redis_password: redhat01
  9. EOF
  10. cat > /root/inventory <<'EOF'
  11. [primary]
  12. localhost ansible_connection=local
  13.  
  14. [all:vars]
  15. admin_password='redhat01'
  16. redis_password='redhat01'
  17. pg_host=''
  18. pg_port=''
  19. pg_database='awx'
  20. pg_username='awx'
  21. pg_password='redhat01'
  22.  
  23. [all:children]
  24. primary
  25. EOF
  26. cat > /root/tower_install.sh <<'EOF'
  27. #!/bin/bash -v
  28. yum install -y epel-release
  29. yum install -y ansible
  30. # Pull and extract the installer
  31. cd /root
  32. curl -O http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
  33. tar xzf ansible-tower-setup-latest.tar.gz
  34. # Get the extracted folder name
  35. ANSIBLE_SETUP_FOLDER=`tar tf ansible-tower-setup-latest.tar.gz | awk -F/ '{ print $1 }' | uniq`
  36. # Copy everything to working directory and install
  37. cp inventory $ANSIBLE_SETUP_FOLDER/inventory
  38. cp tower_setup_conf.yml $ANSIBLE_SETUP_FOLDER/tower_setup_conf.yml
  39. cd $ANSIBLE_SETUP_FOLDER
  40. ./setup.sh
  41. EOF
  42. chmod +x /root/tower_install.sh
  43. /root/tower_install.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement