From caecd0de93a3480422d0660ae9d9ebb9570d39df Mon Sep 17 00:00:00 2001 From: Sachin Prabhu Date: Tue, 7 Apr 2020 15:59:48 +0100 Subject: Split out common actions out of node.prep These actions are also used in preping a client. So we split these actions out into common.prep which can also be used by the client. Signed-off-by: Sachin Prabhu --- vagrant/ansible/roles/common.prep/tasks/main.yml | 29 +++++++++++ vagrant/ansible/roles/node.prep/tasks/main.yml | 61 ++++++++++++++++-------- vagrant/ansible/roles/node.setup/tasks/main.yml | 52 -------------------- vagrant/ansible/setup-cluster.yml | 4 +- 4 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 vagrant/ansible/roles/common.prep/tasks/main.yml delete mode 100644 vagrant/ansible/roles/node.setup/tasks/main.yml diff --git a/vagrant/ansible/roles/common.prep/tasks/main.yml b/vagrant/ansible/roles/common.prep/tasks/main.yml new file mode 100644 index 0000000..91e2e2e --- /dev/null +++ b/vagrant/ansible/roles/common.prep/tasks/main.yml @@ -0,0 +1,29 @@ +- name: create ansible directory (for ssh key) + file: + path: /home/vagrant/ansible + state: directory + +- name: copy ssh key + copy: + src: /home/vagrant/ansible/vagrant_insecure_private_ssh_key + dest: /home/vagrant/ansible/vagrant_insecure_private_ssh_key + +- name: copy ssh config + copy: + src: ssh-config-setup + dest: /home/vagrant/.ssh/config + +- name: copy /etc/hosts + copy: + src: etc-hosts + dest: /etc/hosts + +- name: Perform a complete update + yum: + name: '*' + state: latest + +- name: Enable EPEL repository + yum: + name: epel-release + state: latest diff --git a/vagrant/ansible/roles/node.prep/tasks/main.yml b/vagrant/ansible/roles/node.prep/tasks/main.yml index f0b184c..6867266 100644 --- a/vagrant/ansible/roles/node.prep/tasks/main.yml +++ b/vagrant/ansible/roles/node.prep/tasks/main.yml @@ -1,19 +1,42 @@ -- name: create ansible directory (for ssh key) - file: - path: /home/vagrant/ansible - state: directory - -- name: copy ssh key - copy: - src: /home/vagrant/ansible/vagrant_insecure_private_ssh_key - dest: /home/vagrant/ansible/vagrant_insecure_private_ssh_key - -- name: copy ssh config - copy: - src: ssh-config-setup - dest: /home/vagrant/.ssh/config - -- name: copy /etc/hosts - copy: - src: etc-hosts - dest: /etc/hosts +- name: Enable GlusterFS nightly rpms repository + command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly/master.repo + +- name: Install GlusterFS rpms + yum: + name: "{{ gluster_rpms }}" + state: latest + vars: + gluster_rpms: + - glusterfs-server + +- name: Install basic tools + yum: + name: "{{ tools }}" + state: latest + vars: + tools: + - lvm2 + - firewalld + - libselinux-python + +- name: add copr to get compat-gnutls34 (needed for centos 7) + block: + + - name: Install yum copr plugin + yum: + name: yum-plugin-copr + state: latest + + - name: add copr to get compat-gnutls34 + command: yum -y copr enable sergiomb/SambaAD + + - name: modify copr repo to only use it for compat-gnutls packages + lineinfile: + dest: /etc/yum.repos.d/_copr_sergiomb-SambaAD.repo + line: "includepkgs=compat-gnutls34.* compat-nettle32.*" + insertafter: '\[copr:copr.fedorainfracloud.org:sergiomb:SambaAD\]' + + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' + +- name: Enable Samba nightly rpms repository + command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly-samba/samba-nightly-master.repo diff --git a/vagrant/ansible/roles/node.setup/tasks/main.yml b/vagrant/ansible/roles/node.setup/tasks/main.yml deleted file mode 100644 index 9d246e7..0000000 --- a/vagrant/ansible/roles/node.setup/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ -- name: Perform a complete update - yum: - name: '*' - state: latest - -- name: Enable EPEL repository - yum: - name: epel-release - state: latest - -- name: Enable GlusterFS nightly rpms repository - command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly/master.repo - -- name: Install GlusterFS rpms - yum: - name: "{{ gluster_rpms }}" - state: latest - vars: - gluster_rpms: - - glusterfs-server - -- name: Install basic tools - yum: - name: "{{ tools }}" - state: latest - vars: - tools: - - lvm2 - - firewalld - - libselinux-python - -- name: add copr to get compat-gnutls34 (needed for centos 7) - block: - - - name: Install yum copr plugin - yum: - name: yum-plugin-copr - state: latest - - - name: add copr to get compat-gnutls34 - command: yum -y copr enable sergiomb/SambaAD - - - name: modify copr repo to only use it for compat-gnutls packages - lineinfile: - dest: /etc/yum.repos.d/_copr_sergiomb-SambaAD.repo - line: "includepkgs=compat-gnutls34.* compat-nettle32.*" - insertafter: '\[copr:copr.fedorainfracloud.org:sergiomb:SambaAD\]' - - when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' - -- name: Enable Samba nightly rpms repository - command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly-samba/samba-nightly-master.repo diff --git a/vagrant/ansible/setup-cluster.yml b/vagrant/ansible/setup-cluster.yml index 3cbfcd1..d243513 100644 --- a/vagrant/ansible/setup-cluster.yml +++ b/vagrant/ansible/setup-cluster.yml @@ -4,9 +4,9 @@ vars_files: - cluster-vars.yml roles: - - node.prep + - common.prep - node.test - - node.setup + - node.prep - gluster.infra - gluster.cluster - ctdb.setup -- cgit