playbook.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. - iputils-ping # Needed to check health between nodes
  20. - libcap2-bin # Required for our package
  21. - name: Stop systemd Resolver
  22. systemd:
  23. name: systemd-resolved
  24. state: stopped
  25. enabled: no
  26. - name: Removing bad resolver
  27. lineinfile:
  28. path: /etc/resolv.conf
  29. regexp: 'nameserver\s+127\.0\.0\.53'
  30. state: absent
  31. - name: Adding known good resolver
  32. lineinfile:
  33. path: /etc/resolv.conf
  34. regexp: '^nameserver\s+1.1.1.1'
  35. line: 'nameserver 1.1.1.1'
  36. state: present
  37. - name: create re home dir
  38. file:
  39. state: directory
  40. path: "/redis"
  41. - name: create ephemeral filesystem
  42. filesystem:
  43. fstype: ext4
  44. #dev: "/dev/xvdh"
  45. dev: "/dev/nvme1n1"
  46. - name: mount ephemeral dir filesystem
  47. mount:
  48. name: /redis/ephemeral
  49. #src: /dev/xvdh
  50. src: /dev/nvme1n1
  51. fstype: ext4
  52. state: mounted
  53. - name: create persistant filesystem
  54. filesystem:
  55. fstype: ext4
  56. #dev: "/dev/xvdj"
  57. dev: "/dev/nvme2n1"
  58. - name: mount persistant dir filesystem
  59. mount:
  60. name: /redis/persistant
  61. #src: /dev/xvdj
  62. src: /dev/nvme2n1
  63. fstype: ext4
  64. state: mounted
  65. tasks:
  66. - name: create download directory
  67. file:
  68. state: directory
  69. path: "/var/tmp/re-download"
  70. - name: Unarchive software
  71. unarchive:
  72. src: "https://s3.amazonaws.com/redis-enterprise-software-downloads/5.4.2/redislabs-5.4.2-20-bionic-amd64.tar"
  73. dest: /var/tmp/re-download
  74. remote_src: yes
  75. # - name: Install the software
  76. # command: "./install.sh -y"
  77. # args:
  78. # chdir: /var/tmp/re-download
  79. # creates: /var/opt/redislabs/log/rlcheck.log
  80. # - name: Ensure redislabs owns the volume
  81. # command: "chown -R redislabs:redislabs /redis"