From f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 11 Mar 2018 19:56:38 +0100 Subject: Various fixes before moving to hardware installation --- roles/ands_common/README | 11 +++++++++ roles/ands_common/default/main.yml | 1 + roles/ands_common/tasks/main.yml | 47 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 roles/ands_common/README create mode 100644 roles/ands_common/default/main.yml create mode 100644 roles/ands_common/tasks/main.yml (limited to 'roles/ands_common') diff --git a/roles/ands_common/README b/roles/ands_common/README new file mode 100644 index 0000000..c8bd679 --- /dev/null +++ b/roles/ands_common/README @@ -0,0 +1,11 @@ +Dependencies: + - Executed on all nodes + - No dependencies & no facts + +Parameters: + extra_packages: list of extra packages to install + +Actions: + - Enables standard repositories + - Install a set of common packages on all nodes (mc, etc.) + \ No newline at end of file diff --git a/roles/ands_common/default/main.yml b/roles/ands_common/default/main.yml new file mode 100644 index 0000000..d355d15 --- /dev/null +++ b/roles/ands_common/default/main.yml @@ -0,0 +1 @@ +os_update: "{{ ands_update | default(false) }}" \ No newline at end of file diff --git a/roles/ands_common/tasks/main.yml b/roles/ands_common/tasks/main.yml new file mode 100644 index 0000000..e9196ad --- /dev/null +++ b/roles/ands_common/tasks/main.yml @@ -0,0 +1,47 @@ +- name: Ensure all required repositories are configured + package: name={{item}} state=present + with_items: + - epel-release + - centos-release-openshift-origin + +- name: Add our repository with updates and overrides + yum_repository: name="{{ item.name }}" description= "{{ item.description | default('Ands repository') }}" baseurl="{{ item.url }}" enabled="yes" gpgcheck="no" cost="{{ item.cost | default(1) }}" + with_items: "{{ ands_repositories | default([]) }}" + +- name: Ensure GlusterFS repositories are present + yum: name="centos-release-gluster{{ glusterfs_version }}" state=present + +# Seems we need iptables-services at least temporary... +- name: Ensure all required packages are installed + package: name={{item}} state=present + register: result + with_items: + - mc + - bzr + - git + - yamllint + - pyOpenSSL + - python-passlib + - python2-ruamel-yaml + - python2-jmespath + - python-ipaddress + - iptables-services + - PyYAML + - python-rhsm-certificates + - glusterfs-fuse + - telnet + - yum-plugin-versionlock + +# We always update on first install and if requested +- name: Update CentOS + yum: name=* state=latest update_cache=yes + when: (result | changed) or (os_update | default(false)) + +#- name: Add NodeJS required by a few used Ansible extensions +# package: name={{item}} state=present +# with_items: +# - nodejs + +- name: Ensure all extra packages are installed + package: name={{item}} state=present + with_items: "{{ extra_packages | default([]) }}" -- cgit v1.2.3