Commit 9a2346f8 authored by Chris Hines's avatar Chris Hines
Browse files

Merge pull request #166 from l1ll1/master

remove all yum updates and apt-get upgrades except from roles specifi…
parents 0a0336cd 70176d27
......@@ -3,7 +3,7 @@
-
name: "Installing Apache"
sudo: true
yum: name={{ item }} state=latest
yum: name={{ item }} state=present
with_items:
- mod_ssl
- mod_wsgi
......
---
- name: "Install extra packages"
yum: "name={{ item }} state=latest"
yum: "name={{ item }} state=present"
with_items:
pkgs
sudo: true
......
......@@ -14,7 +14,7 @@
when: ansible_distribution == 'CentOS' and importRepo is defined
- name: Install yum packages
yum: name={{ item }} state=latest
yum: name={{ item }} state=present
with_items: yumPackageList
sudo: true
when: ansible_distribution == 'CentOS' and yumPackageList is defined
......
......@@ -2,7 +2,7 @@
- include_vars: "{{ ansible_distribution }}_{{ ansible_distribution_version }}_{{ ansible_architecture }}.yml"
- name: install system packages apt
apt: name={{ item }} state=installed update_cache=true
apt: name={{ item }} state=installed
sudo: true
with_items: system_packages
when: ansible_os_family == 'Debian'
......
......@@ -26,7 +26,7 @@
-
name: "Installing prerequisites Redhat"
yum: name={{ item }} state=latest
yum: name={{ item }} state=present
sudo: true
with_items:
- libxml2-devel
......
---
- name: "Install open ldap package yum"
yum: name={{ item }} state=latest
yum: name={{ item }} state=present
with_items:
- openldap
- openldap-clients
......@@ -13,7 +13,7 @@
when: ansible_os_family == 'RedHat'
- name: "Install open ldap package apt"
action: apt pkg={{ item }} state=installed
action: apt pkg={{ item }} state=present
with_items:
- ldap-utils
- sssd
......
......@@ -14,30 +14,32 @@
register: drivers_installed
ignore_errors: true
- name: yum update to upgrade kernel
shell: "yum update -y"
sudo: true
ignore_errors: true
when: ansible_os_family == "RedHat" and drivers_installed|failed
# This is NASTY. Don't upgrade production systems without taking them out of the queue first.
#- name: yum update to upgrade kernel
# shell: "yum update -y"
# sudo: true
# ignore_errors: true
# when: ansible_os_family == "RedHat" and drivers_installed|failed
#
# A REBOOT IS NEEDED AFTER a KERNEL UPDATE
#
- name: restart machine
shell: sleep 5; sudo shutdown -r now "Ansible updates triggered"
async: 2
poll: 0
ignore_errors: true
sudo: true
when: ansible_os_family == "RedHat" and drivers_installed|failed
- name: waiting for server to come back
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
- name: waiting for server to come back number 2
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
#- name: restart machine
# shell: sleep 5; sudo shutdown -r now "Ansible updates triggered"
# async: 2
# poll: 0
# ignore_errors: true
# sudo: true
# when: ansible_os_family == "RedHat" and drivers_installed|failed
#
#- name: waiting for server to come back
# local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
# sudo: false
#
#- name: waiting for server to come back number 2
# local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
# sudo: false
- name: copy driver source
......@@ -89,6 +91,7 @@
insertafter: "auto {{ MELLANOX_DEVICE_NAME }}"
sudo: true
when: ansible_os_family=="Debian" and drivers_installed|failed
- name: Ubuntu network interfaces - line 3
lineinfile:
args:
......@@ -107,7 +110,7 @@
poll: 0
ignore_errors: true
sudo: true
when: ansible_os_family=="Centos" and drivers_installed|failed
when: ansible_os_family=="RedHat" and drivers_installed|failed
- name: restart machine for Ubuntu -cos it is 'special'
shell: "sleep 5; sudo shutdown -r now"
......@@ -115,19 +118,21 @@
poll: 1
ignore_errors: true
sudo: true
when: ansible_os_family=="Debian"
when: ansible_os_family=="Debian" and drivers_installed|failed
- name: waiting for server to come back
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
when: drivers_installed|failed
- name: waiting for server to come back 2
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
when: drivers_installed|failed
- name: bring up interface
#variable=eth0 or ens6
command: ifup {{ MELLANOX_DEVICE_NAME }}
sudo: true
when: ansible_distribution_major_version == "7"
when: ansible_os_family=="RedHat" and ansible_distribution_major_version == "7"
......@@ -6,7 +6,7 @@
when: ansible_os_family == "Debian"
- name: Installing MySQL RedHat
yum: name="{{ item }}" state=latest
yum: name="{{ item }}" state=present
with_items: client_packages
sudo: true
when: ansible_os_family == "RedHat"
......@@ -4,6 +4,6 @@
with_items:
- nfs-common
- nfs-kernel-server
apt: "name={{ item }} state=latest"
apt: "name={{ item }} state=present"
sudo: true
......@@ -4,5 +4,5 @@
with_items:
- bind-utils
- nfs-utils
yum: "name={{ item }} state=latest"
yum: "name={{ item }} state=present"
sudo: true
---
- name: install nfs kernel server
apt: name=nfs-kernel-server state=latest
apt: name=nfs-kernel-server state=present
sudo: true
when: ansible_os_family == "Debian"
......
---
- name: "update cache centos"
shell: yum update -y
sudo: true
when: ansible_os_family == 'RedHat'
- name: "update cache debian"
shell: apt-get update -y
sudo: true
when: ansible_os_family == 'Debian'
---
- name: install deps
yum: name={{ item }} state=installed
sudo: true
with_items:
- gcc
- rpm-build
- wget
- openssl-devel
- readline-devel
- pam-devel
- perl-ExtUtils-MakeMaker
- bzip2-devel
- mysql
- mysql-devel
when: ansible_os_family == "RedHat"
- name: install deps
apt: name={{ item }} state=installed update_cache=yes
sudo: true
with_items:
- gcc
- wget
- libssl-dev
- libpam0g-dev
- libbz2-dev
when: ansible_os_family == "Debian"
- name: get munge
shell: wget https://munge.googlecode.com/files/munge-{{ munge_version }}.tar.bz2
args:
chdir: /tmp
creates: /tmp/munge-{{ munge_version }}.tar.bz2
- name: make munge rpms
shell: rpmbuild -ta --clean munge-{{ munge_version }}.tar.bz2
sudo: true
args:
chdir: /tmp
creates: /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm
when: ansible_os_family == "RedHat"
- name: untar munge
shell: tar jxf /tmp/munge-{{ munge_version }}.tar.bz2
sudo: true
args:
chdir: /tmp
creates: /tmp/munge-{{ munge_version }}
when: ansible_os_family == "Debian"
- name: build munge
shell: configure && make && make install
sudo: true
args:
chdir: /tmp/munge-{{ munge_version }}
when: ansible_os_family == "Debian"
- name: get slurm
shell: wget http://www.schedmd.com/download/latest/slurm-{{ slurm_version }}.tar.bz2
args:
chdir: /tmp
creates: /tmp/slurm-{{ slurm_version }}.tar.bz2
- name: check munge installation
shell: rpm -qa munge
register: munge_installed
when: ansible_os_family == "RedHat"
- name: install munge deps
shell: rpm -i /root/rpmbuild/RPMS/x86_64/munge-libs-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-devel-{{ munge_version }}-1.el6.x86_64.rpm
sudo: true
when: munge_installed.stdout.find("munge") == -1
- name: make slurm rpms
shell: rpmbuild -ta --clean slurm-{{ slurm_version }}.tar.bz2
sudo: true
args:
chdir: /tmp
creates: /root/rpmbuild/RPMS/x86_64/slurm-{{ slurm_version }}-1.el6.x86_64.rpm
- name: copy rpms
shell: cp -r /root/rpmbuild /tmp
sudo: true
args:
creates: /tmp/rpmbuild/RPMS/x86_64/slurm-{{ slurm_version }}-1.el6.x86_64.rpm
- name: retrieve rpms 1
shell: scp -o StrictHostKeyChecking=no -r {{ hostvars[ansible_hostname]['ansible_user_id'] }}@{{ ansible_ssh_host }}:/tmp/rpmbuild/ /tmp
delegate_to: 127.0.0.1
when: ansible_ssh_host is defined
- name: retrieve rpms 2
shell: scp -r {{ hostvars[ansible_hostname]['ansible_user_id'] }}@{{ ansible_hostname }}:/tmp/rpmbuild/ /tmp
delegate_to: 127.0.0.1
when: ansible_ssh_host is not defined
......@@ -64,7 +64,7 @@
sudo: true
- name: install deps
yum: name={{ item }} state=latest
yum: name={{ item }} state=present
with_items:
- perl
- perl-DBI
......
......@@ -9,13 +9,6 @@
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
ignore_errors: true
- name: add epel on CentOS 7
shell: yum -y update
sudo: true
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
- name: install system packages apt
apt: name={{ item }} state=installed update_cache=true
......
......@@ -23,14 +23,8 @@
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
ignore_errors: true
- name: add epel on CentOS 7
shell: yum -y update
sudo: true
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
- name: install system packages apt
apt: name={{ item }} state=installed update_cache=true force=yes
apt: name={{ item }} state=present update_cache=true force=yes
sudo: true
with_items: system_packages
when: ansible_os_family == 'Debian'
......@@ -42,7 +36,7 @@
when: system_group_packages is defined
- name: install system packages yum
yum: name={{ item }} state=installed update_cache=yes
yum: name={{ item }} state=present update_cache=yes
sudo: true
with_items: system_packages
when: ansible_os_family == 'RedHat'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment