Last active
November 18, 2019 13:32
-
-
Save ccollicutt/2a96ca4f03a7f18b9da9 to your computer and use it in GitHub Desktop.
Quick Ansible playbook to deploy newest sysbench to an Ubuntu Trusty 14.04 server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: | |
- mysql-client | |
vars: | |
- sysbench_source_location: "/usr/local/src/sysbench" | |
tasks: | |
- name: install percona apt key | |
apt_key: | |
keyserver=keys.gnupg.net | |
id=1C4CBDCDCD2EFD2A | |
- name: install percona repo | |
apt_repository: | |
repo="deb http://repo.percona.com/apt trusty main" | |
state=present | |
- name: install required packages | |
apt: | |
name={{ item }} | |
state=installed | |
update_cache=yes | |
cache_valid_time=3600 | |
with_items: | |
- build-essential | |
- autoconf | |
- automake | |
- make | |
- libtool | |
- libssl-dev | |
- libcrypto++9 | |
- libperconaserverclient18-dev | |
- git | |
- name: install sysbench git repo | |
git: | |
repo="https://github.com/akopytov/sysbench" | |
dest={{ sysbench_source_location }} | |
- name: see if sysbench is installed | |
command: which sysbench | |
register: sysbench_installed | |
ignore_errors: True | |
changed_when: False | |
- name: run autogen.sh | |
shell: ./autogen.sh | |
args: | |
chdir: "{{ sysbench_source_location }}" | |
creates: "{{ sysbench_source_location }}/configure" | |
- name: run configure | |
shell: ./configure --prefix=/usr --mandir=/usr/share/man | |
args: | |
chdir: "{{ sysbench_source_location }}" | |
creates: "{{ sysbench_source_location }}/Makefile" | |
- name: make and install | |
shell: make && make install | |
args: | |
chdir: "{{ sysbench_source_location }}" | |
when: sysbench_installed.rc > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment