diff --git a/.travis.yml b/.travis.yml index 4548937..bd547de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: "2.7" env: - ANSIBLE_VERSION=latest + - ANSIBLE_VERSION=2.5.2 - ANSIBLE_VERSION=2.5.1 - ANSIBLE_VERSION=2.5.0 - ANSIBLE_VERSION=2.4.4.0 diff --git a/README.md b/README.md index c0a8d19..fc0cba1 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,15 @@ None * `percona_toolkit_table_checksum.ignore_databases`: [optional]: Ignore this list of databases (e.g. `['information_schema', 'common_schema']`) * `percona_toolkit_table_checksum.opts`: [optional, default: `[]`]: Additional options +##### (Custom) scripts + +* `percona_toolkit_script_map`: [default: `[]`]: Script declarations +* `percona_toolkit_script_map.{n}.src`: The local path of the file to copy, can be absolute or relative (e.g. `../../../files/percona-toolkit/usr/local/bin/pt-truncate-database.sh`) +* `percona_toolkit_script_map.{n}.dest`: The remote path of the file to copy (e.g. `/usr/local/bin/pt-truncate-database`) +* `percona_toolkit_script_map.{n}.owner`: The name of the user that should own the file (optional, default `root`) +* `percona_toolkit_script_map.{n}.group`: The name of the group that should own the file (optional, default `root`) +* `percona_toolkit_script_map.{n}.mode`: The mode of the file, such as 0644 (optional, default `0755`) + ## Dependencies None diff --git a/defaults/main.yml b/defaults/main.yml index 2a767b9..3c560d6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,9 @@ # defaults file for percona-toolkit --- percona_toolkit_cron_jobs: [] + percona_toolkit_deadlock_logger: {} percona_toolkit_heartbeat: {} percona_toolkit_table_checksum: {} + +percona_toolkit_script_map: [] diff --git a/tasks/main.yml b/tasks/main.yml index c0b94ff..d55a246 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,6 +18,12 @@ - percona-toolkit - percona-toolkit-configure +- include: scripts.yml + tags: + - configuration + - percona-toolkit + - percona-toolkit-scripts + - include: jobs.yml tags: - configuration diff --git a/tasks/scripts.yml b/tasks/scripts.yml new file mode 100644 index 0000000..71f091a --- /dev/null +++ b/tasks/scripts.yml @@ -0,0 +1,10 @@ +# tasks file for percona-server-tools +--- +- name: scripts | copy files + copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "{{ item.owner | default('root') }}" + group: "{{ item.group | default('root') }}" + mode: "{{ item.mode | default('0755') }}" + with_items: "{{ percona_toolkit_script_map }}"