Advertisement
Guest User

Untitled

a guest
May 21st, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. bootstrap.yaml
  2. ==============
  3. ---
  4. - hosts: '*'
  5. remote_user: root
  6.  
  7. vars:
  8. root_password: "$1$MIs4WGHz$SYHl7IabC1SSY8scWGLrP0"
  9.  
  10. tasks:
  11. - name: Set hostname
  12. copy: content="{{ inventory_hostname }}" dest=/etc/hostname
  13.  
  14. - include: bootstrap/centos.yaml
  15. when: ansible_os_family == 'RedHat'
  16.  
  17. - include: bootstrap/debian.yaml
  18. when: ansible_os_family == 'Debian'
  19.  
  20. - name: Place laptop ssh key
  21. authorized_key: user=root key="{{ lookup('file', '/Users/yzguy/.ssh/id_rsa.pub') }}"
  22.  
  23. - name: Set root password
  24. user: name=root password={{ root_password }}
  25.  
  26. - name: Place authorized_keys
  27. authorized_key: user=root key="{{ item }}"
  28. with_file:
  29. - public_keys/jenkins
  30.  
  31. bootstrap/centos.yaml
  32. =====================
  33. - name: Install epel-release repository
  34. yum: name=epel-release state=present
  35.  
  36. - name: Install yum packages
  37. yum: name="{{ item }}" state=present
  38. with_items:
  39. - git
  40. - tmux
  41. - curl
  42. - wget
  43. - htop
  44. - vim-enhanced
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement