playbook.yml 2.1 KB

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