playbook.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ---
  2. - hosts: all
  3. become: yes
  4. become_user: root
  5. become_method: sudo
  6. gather_facts: yes
  7. pre_tasks:
  8. - name: Update Apt Cache
  9. apt: update_cache=yes cache_valid_time=86400
  10. when: ansible_os_family == "Debian"
  11. - name: Ubuntu Packages
  12. apt: >
  13. pkg={{item}}
  14. state=present
  15. with_items:
  16. - jq
  17. - tree
  18. - sysstat
  19. - libcap2-bin # Required for our package
  20. - name: Stop systemd Resolver
  21. systemd:
  22. name: systemd-resolved
  23. state: stopped
  24. enabled: no
  25. - name: Removing bad resolver
  26. lineinfile:
  27. path: /etc/resolv.conf
  28. regexp: 'nameserver\s+127\.0\.0\.53'
  29. state: absent
  30. - name: Adding known good resolver
  31. lineinfile:
  32. path: /etc/resolv.conf
  33. regexp: '^nameserver\s+1.1.1.1'
  34. line: 'nameserver 1.1.1.1'
  35. state: present
  36. - name: create re home dir
  37. file:
  38. state: directory
  39. path: "/redis"
  40. - name: create ephemeral filesystem
  41. filesystem:
  42. fstype: ext4
  43. dev: "/dev/xvdh"
  44. - name: mount ephemeral dir filesystem
  45. mount:
  46. name: /redis/ephemeral
  47. src: /dev/xvdh
  48. fstype: ext4
  49. state: mounted
  50. - name: create persistant filesystem
  51. filesystem:
  52. fstype: ext4
  53. dev: "/dev/xvdj"
  54. - name: mount persistant dir filesystem
  55. mount:
  56. name: /redis/persistant
  57. src: /dev/xvdj
  58. fstype: ext4
  59. state: mounted
  60. tasks:
  61. - name: create download directory
  62. file:
  63. state: directory
  64. path: "/var/tmp/re-download"
  65. - name: Unarchive software
  66. unarchive:
  67. src: "https://s3.amazonaws.com/redis-enterprise-software-downloads/5.4.2/redislabs-5.4.2-20-bionic-amd64.tar"
  68. dest: /var/tmp/re-download
  69. remote_src: yes
  70. # - name: Install the software
  71. # command: "./install.sh -y"
  72. # args:
  73. # chdir: /var/tmp/re-download
  74. # creates: /var/opt/redislabs/log/rlcheck.log
  75. # - name: Ensure redislabs owns the volume
  76. # command: "chown -R redislabs:redislabs /redis"