playbook.yml 2.1 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: Load vars
  9. include_vars: "{{ item }}"
  10. with_first_found:
  11. - "{{ ansible_hostname }}.yaml"
  12. - "default.yaml"
  13. - name: Update Apt Cache
  14. apt:
  15. update_cache: yes
  16. - name: Ubuntu Packages
  17. package:
  18. name: "{{ deb_packages }}"
  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. dev: "/dev/nvme1n1"
  44. when: enable_volumes
  45. - name: mount ephemeral dir filesystem
  46. mount:
  47. name: /redis/ephemeral
  48. src: /dev/nvme1n1
  49. fstype: ext4
  50. state: mounted
  51. when: enable_volumes
  52. - name: create persistant filesystem
  53. filesystem:
  54. fstype: ext4
  55. dev: "/dev/nvme2n1"
  56. when: enable_volumes
  57. - name: mount persistant dir filesystem
  58. mount:
  59. name: /redis/persistant
  60. src: /dev/nvme2n1
  61. fstype: ext4
  62. state: mounted
  63. when: enable_volumes
  64. tasks:
  65. - name: create download directory
  66. file:
  67. state: directory
  68. path: "/var/tmp/re-download"
  69. - name: Unarchive software
  70. unarchive:
  71. src: "https://s3.amazonaws.com/redis-enterprise-software-downloads/6.0.20/redislabs-6.0.20-95-bionic-amd64.tar"
  72. dest: /var/tmp/re-download
  73. remote_src: yes
  74. - name: Install the software
  75. command: "./install.sh -y"
  76. args:
  77. chdir: /var/tmp/re-download
  78. creates: /var/opt/redislabs/log/rlcheck.log