diff --git a/.gitmodules b/.gitmodules index 6281923..a03a8a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,24 +1,27 @@ [submodule "nfs"] path = roles/nfs url = https://github.com/geerlingguy/ansible-role-nfs.git [submodule "roles/swap"] path = roles/swap url = https://github.com/tribou/ansible-swap.git [submodule "roles/yumrepo"] path = roles/yumrepo url = https://github.com/picotrading/ansible-yumrepo.git [submodule "templates/encoder"] path = templates/encoder url = https://github.com/picotrading/config-encoder-macros [submodule "roles/keepalived"] path = roles/keepalived url = https://github.com/tcomerma/ansible-keepalived.git [submodule "roles/glusterfs"] path = roles/glusterfs url = https://github.com/geerlingguy/ansible-role-glusterfs.git [submodule "roles/nagios"] path = roles/nrpe url = https://github.com/Mooash/nagios-nrpe-server.git [submodule "roles/jenkins"] path = roles/jenkins url = https://github.com/rorist/ansible-jenkins +[submodule "roles/rolling-reboot"] + path = roles/rolling-reboot + url = https://github.com/rorist/ansible-rolling-reboot.git diff --git a/reboot.yml b/reboot.yml new file mode 100644 index 0000000..99aa1e9 --- /dev/null +++ b/reboot.yml @@ -0,0 +1,50 @@ +--- +- name: Create Instances + hosts: 127.0.0.1 + connection: local + gather_facts: false + vars_files: + - "vars/main.yml" + tasks: + - include: tasks/create-instances.yml + +- name: Reboot monit instances + hosts: monit + user: centos + sudo: yes + serial: 50% + vars_files: + - "vars/main.yml" + roles: + - role: rolling-reboot + +- name: Reboot database instances + hosts: dbs + user: centos + sudo: yes + serial: 25% + vars_files: + - "vars/main.yml" + roles: + - role: rolling-reboot + +- name: Reboot app instances + hosts: app + user: centos + sudo: yes + serial: 25% + vars_files: + - "vars/main.yml" + roles: + - role: rolling-reboot + +- name: Reboot ci instances + hosts: ci + user: centos + sudo: yes + serial: 50% + vars_files: + - "vars/main.yml" + roles: + - role: rolling-reboot + diff --git a/roles/rolling-reboot b/roles/rolling-reboot new file mode 160000 index 0000000..2db82da --- /dev/null +++ b/roles/rolling-reboot @@ -0,0 +1 @@ +Subproject commit 2db82da5ce3e034928594ab0e18ad03f17a87360 diff --git a/vars/main.yml.example b/vars/main.yml.example index 64aab48..16741c1 100644 --- a/vars/main.yml.example +++ b/vars/main.yml.example @@ -1,70 +1,74 @@ --- project_name: "c4science" ansible_ssh_user: "centos" user_pwd_root: "" user_pwd_centos: "" # OpenStack keypair_name: "" image_id: "" image_id_coreos: "" public_net: "" private_net: "" flavor_id_small: "" flavor_id_medium: "" flavor_id_large: "" flavor_id_small_backup: "" private_net_backup: "" image_id_backup: "" region_main: "" region_back: "" # Storage s3_access_key: "" s3_secret_key: "" s3_endpoint: "" s3_bucket: "" s3_region: "" # Lbs external_ip: 0.0.0.0 backup_ip: 0.0.0.0 jenkins_port: 8080 stats_port: 8082 monit_port: 8081 monit_user: admin monit_pass: +rolling_reboot_proxy_host: "{{ external_ip }}" +rolling_reboot_pause: 30 +rolling_reboot_wait_delay: 20 + # App domain: example.com phabricator_path: /srv/www/facebook/ repositories_path: /var/repo/ phd_user: phabricator www_user: apache vcs_user: git vcs_port: 2222 jenkins_admin_user: admin jenkins_admin_pass: phabricator_domains: - 'example.com' # Dbs mysql_app_user: "" mysql_app_pass: "" mysql_lbs_user: "haproxy" mysql_cluster_name: "" # SSH ssh_keys: - "ssh-rsa mysuperkey1" - "ssh-rsa mysuperkey2" # Swap swap_path: "/swapfile" dd_bs_size_mb: 32 swap_count: 128 swappiness: 10 vfs_cache_pressure: 50