Browse Source

pudate node config

Chris Mague 5 years ago
parent
commit
3f246dfbcc
4 changed files with 122 additions and 0 deletions
  1. 5 0
      README.md
  2. 111 0
      ansible/test_nodes.yml
  3. 1 0
      maguec1.tfvars
  4. 5 0
      main.tf

+ 5 - 0
README.md

@@ -21,3 +21,8 @@ chmod 0600 ~/.ssh/maguec1.pem
 ```
 ansible-playbook ansible/cp_nodes.yml --private-key ~/.ssh/maguec1.pem -i /tmp/maguec1_all_nodes.ini
 ```
+
+```
+ansible-playbook ansible/test_nodes.yml --private-key ~/.ssh/maguec1.pem -i /tmp/tester.ini 
+```
+

+ 111 - 0
ansible/test_nodes.yml

@@ -0,0 +1,111 @@
+---
+
+- 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
+        - libevent-openssl-2.1-6
+        - libpcre3-dev 
+        - libevent-dev
+        - pkg-config
+        - zlib1g-dev
+        - libssl-dev
+
+  tasks:
+    - name: create redis user
+      user:
+        name: redis
+        uid: 4001
+        shell: /bin/bash
+        state: present
+
+    - 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
+
+    - name: checkout memtier_benchmark git repo
+      git:
+        repo: 'https://github.com/RedisLabs/memtier_benchmark'
+        dest: /home/redis/memtier_benchmark
+        version: 1.2.17
+
+    - name: Run the autoconf
+      command: autoreconf -ivf
+      args:
+        chdir: /home/redis/memtier_benchmark
+        creates: /home/redis/memtier_benchmark/configure
+
+    - name: Run the configure script first
+      command: ./configure
+      args:
+        chdir: /home/redis/memtier_benchmark
+        creates: /home/redis/memtier_benchmark/Makefile
+
+    - name: Build the default target
+      make:
+        chdir: /home/redis/memtier_benchmark
+
+    - name: Run 'memtier_benchmark install' target as root
+      make:
+        chdir: /home/redis/memtier_benchmark
+        target: install
+      become: yes
+
+    - name: checkout twemproxy git repo
+      git:
+        repo: 'https://github.com/twitter/twemproxy'
+        dest: /home/redis/twemproxy
+        version: master
+
+    - name: Run the autoconf in twemproxy
+      command: autoreconf -ivf
+      args:
+        chdir: /home/redis/twemproxy
+        creates: /home/redis/twemproxy/configure
+
+    - name: Run the twemproxy configure
+      command: ./configure
+      args:
+        chdir: /home/redis/twemproxy
+        creates: /home/redis/twemproxy/Makefile
+
+    - name: Build the twemporxy target
+      make:
+        chdir: /home/redis/twemproxy
+
+    - name: Run 'twemproxy install' target as root
+      make:
+        chdir: /home/redis/twemproxy
+        target: install
+      become: yes

+ 1 - 0
maguec1.tfvars

@@ -7,5 +7,6 @@ vpc-name  = "maguec1"
 common-tags     = {
   "Owner"       = "maguec"
   "Project"     = "cp-redis"
+  "Environment" = "test"
 }
 

+ 5 - 0
main.tf

@@ -80,3 +80,8 @@ resource "null_resource" "remote-config" {
 output "node-ips" {
   value = formatlist("ssh -i ~/.ssh/${var.vpc-name}.pem -o IdentitiesOnly=yes  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ubuntu@%s", module.nodes.node-ips)
 }
+
+output "tester-ips" {
+  value = formatlist("ssh -i ~/.ssh/${var.vpc-name}.pem -o IdentitiesOnly=yes  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ubuntu@%s", aws_eip.re-eip.public_ip)
+}
+