From 649f0dd9c5ca586d8b637400dd19c0c4059447d6 Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Wed, 30 Aug 2017 13:09:56 -0600 Subject: initial commit --- salt/openbook/ansible/files/mysql_client.yaml | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 salt/openbook/ansible/files/mysql_client.yaml (limited to 'salt/openbook/ansible/files/mysql_client.yaml') diff --git a/salt/openbook/ansible/files/mysql_client.yaml b/salt/openbook/ansible/files/mysql_client.yaml new file mode 100644 index 0000000..6ee58be --- /dev/null +++ b/salt/openbook/ansible/files/mysql_client.yaml @@ -0,0 +1,60 @@ +--- +- name: "Install mysql client" + hosts: target + tasks: + - name: "Install mariadb apt key" + shell: apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 + when: ansible_distribution == "Ubuntu" + + - name: "Configure mariadb.list" + copy: + src: "../files/{{ item }}" + dest: "/etc/apt/sources.list.d/{{ item }}" + mode: 0644 + owner: root + group: root + with_items: + - mariadb.list + when: ansible_distribution == "Ubuntu" + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install mariadb-client package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - mariadb-client-10.1 + when: ansible_distribution == "Ubuntu" + + - name: "Add mariadb repository" + yum_repository: + name: MariaDB + description: MariaDB + baseurl: http://yum.mariadb.org/10.1/centos7-amd64 + gpgkey: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install mariadb-client package" + yum: + name: "{{ item }}" + state: present + with_items: + - MariaDB-client + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install mariadb-client package" + portage: + name: "{{ item }}" + state: present + with_items: + - dev-db/mariadb + when: ansible_distribution == "Gentoo" -- cgit v1.3