diff --git a/.gitmodules b/.gitmodules index 0f8368b..38fdbd6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,9 @@ [submodule "nfs"] path = roles/nfs url = https://github.com/geerlingguy/ansible-role-nfs.git [submodule "roles/jenkins"] path = roles/jenkins url = https://github.com/ICTO/ansible-jenkins.git +[submodule "roles/swap"] + path = roles/swap + url = https://github.com/tribou/ansible-swap.git diff --git a/README.md b/README.md index 0984d2b..21f1688 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,65 @@ C4SCIENCE ========= * Ansible playbook for git infrastructure on openstack INSTALL ------- * You need ansible >= 2.0 ``` cd ~ git clone https://github.com/ansible/ansible.git cd ansible git submodule update --init --recursive sudo python setup.py install sudo pip install shade sudo apt-get install python-nova ``` USAGE ----- * How to use, ``` make status #list instances make up #create instances make clean #destroy instances ``` * You must create an Switch Engines bucket * see https://help.switch.ch/engines/documentation/s3-like-object-storage/ ``` ./s3cmd mb s3://phabricator ``` * you must create a volume for the repo, and attach it to the jump server ``` nova volume-create 100 nova volume-attach /dev/vdb ``` TODO ---- * Shibboleth auth * Volumes for /var/lib/mysql + +TEST +---- + +* Some benchmarking examples, + +``` +# GIT +cd /tmp +parallel -j 10 git clone ssh://git@86.119.28.215:1234/diffusion/TESTA/test.git \ + -- $(for i in $(seq 20); do echo test$i; done) 1> /dev/null +# HTTP +ab -C phsid:cz27psxxn2zjxtkw4v2tokhbjy4ix2lrifj6exm3 -C phusr:admin -n 1000 \ + -c 10 http://86.119.28.215/diffusion/TESTA/repository/master/ +``` diff --git a/main.yml b/main.yml index 279f8a4..59474f0 100644 --- a/main.yml +++ b/main.yml @@ -1,69 +1,79 @@ --- - 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: Configure Jump Server hosts: lbs vars_files: - "vars/main.yml" + - "vars/swap.yml" user: centos sudo: yes pre_tasks: #- debug: var=hostvars['127.0.0.1']['openstackjump']['private_ip'][0] - include: tasks/common.yml - include: tasks/configure-jump.yml roles: + - role: swap/roles/swap - role: nfs nfs_server_daemon: nfs-server # doesn't work as it's in vars not default handlers: - include: handlers/main.yml - name: Configure Databases hosts: dbs vars_files: - "vars/main.yml" + - "vars/swap.yml" user: centos sudo: yes + roles: + - role: swap/roles/swap tasks: - include: tasks/common.yml - include: tasks/configure-dbs.yml handlers: - include: handlers/main.yml - name: Configure App hosts: app vars_files: - "vars/main.yml" + - "vars/swap.yml" user: centos sudo: yes + roles: + - role: swap/roles/swap tasks: - include: tasks/common.yml - include: tasks/configure-app.yml handlers: - include: handlers/main.yml #- name: Configure Jenkins # hosts: ci # vars_files: # - "vars/main.yml" +# - "vars/swap.yml" # user: centos # sudo: yes # tasks: # - include: tasks/common.yml # roles: +# - role: swap/roles/swap # - role: jenkins # plugins: # - 'ldap' # - 'preSCMbuildstep' # prefix: '/build' # email: # smtp_host: 'mail.epfl.ch' # smtp_ssl: 'true' # default_email_suffix: '@epfl.ch' # diff --git a/roles/swap b/roles/swap new file mode 160000 index 0000000..801a751 --- /dev/null +++ b/roles/swap @@ -0,0 +1 @@ +Subproject commit 801a751ce4f8a99804f20dbe4aba4e64c5f1e5b8 diff --git a/vars/swap.yml b/vars/swap.yml new file mode 100644 index 0000000..f1141f7 --- /dev/null +++ b/vars/swap.yml @@ -0,0 +1,21 @@ +--- +# All ansible-swap variables +# Override any in your local ansible group_vars/swap.yml + +# Location of swapfile +swap_path: "/swapfile" + +# Hosts with low RAM may need to use a small bs size +dd_bs_size_mb: 32 + +# Total size for swapfile +# Count of how many passes dd should make at bs size +swap_count: 128 + +# 0 to 100, how often swap is utilized +# 60 is good for desktops, 10 is good for VPS +swappiness: 10 + +# How often inode info is removed from cache +# Usually a frequent and costly lookup if not cached +vfs_cache_pressure: 50