فهرست منبع

build and install redis server version 6.0

Chris Mague 5 سال پیش
والد
کامیت
d594b3c195
4فایلهای تغییر یافته به همراه57 افزوده شده و 0 حذف شده
  1. 1 0
      .gitignore
  2. 5 0
      README.md
  3. 51 0
      ansible/cp_nodes.yml
  4. BIN
      ansible/files/redisraft.so

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 .terraform/
 terraform.tfstate*
+ansible/*.retry

+ 5 - 0
README.md

@@ -16,3 +16,8 @@ sed -e s/\"//g >> ~/.ssh/maguec1.pem
 chmod 0600 ~/.ssh/maguec1.pem
 ```
 
+# After ansible
+
+```
+ansible-playbook ansible/cp_nodes.yml --private-key ~/.ssh/maguec1.pem -i /tmp/maguec1_all_nodes.ini
+```

+ 51 - 0
ansible/cp_nodes.yml

@@ -0,0 +1,51 @@
+---
+
+- hosts: all
+  become: yes
+  become_user: root
+  become_method: sudo
+  gather_facts: yes
+
+  pre_tasks:
+    - name: Update Apt Cache
+      apt: update_cache=yes cache_valid_time=86400
+      when: ansible_os_family == "Debian"
+    - name: Ubuntu Packages
+      apt: >
+        pkg={{item}}
+        state=present
+      with_items:
+        - build-essential
+        - autoconf
+        - automake
+        - libbsd-dev
+        - libltdl-dev
+        - libltdl7
+        - libtool
+  tasks:
+    - name: create redis user
+      user:
+        name: redis
+        uid: 4001
+        shell: /bin/bash
+        state: present
+    - name: copy the redis raft library
+      copy:
+        src: redisraft.so
+        dest: /usr/lib/redisraft.so
+        owner: redis
+        group: redis
+        mode: '0644'
+    - name: checkout redis git repo
+      git:
+        repo: 'https://github.com/antirez/redis'
+        dest: /home/redis/redis
+        version: 6.0
+    - name: Build the default target
+      make:
+        chdir: /home/redis/redis
+    - name: Run 'install' target as root
+      make:
+        chdir: /home/redis/redis
+        target: install
+      become: yes

BIN
ansible/files/redisraft.so