blob: ba514e76dfb2317af04149058937c731d5872faf [file]
---
# tasks file for apigee-opdk-setup-os
- name: Configure AWS AMI OS package manager repositories for Apigee
shell: "yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional"
when: ansible_bios_version | lower | search('amazon') and ansible_os_family | lower == 'redhat' and ansible_distribution_major_version | version_compare('6', '>')
# TODO: Look up the ansible_distribution name for RHEL systems
#- name: If using RHEL then register RHEL on RHN
# shell: "subscription-manager register --username={{ rhel_user_name }} --password={{ rhel_password }} --auto-attach"
# when: ansible_bios_version | lower | search('amazon') and ansible_os_family | lower == 'redhat' and ansible_distribution_major_version | version_compare('7', '>')
- name: Yum clean
become: yes
shell: yum clean all
- block:
- name: Add yum centos-release-SCL repository for CentOS 6
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- centos-release-SCL
when: ansible_distribution | lower == "centos"
tags:
- epel
- name: Add yum epel repository for Redhat/CentOS 6.x
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- '{{ epel_rhel6 }}'
tags:
- epel
when: ansible_distribution_major_version is defined and ansible_distribution_major_version | version_compare('7', '<')
- block:
- name: Add yum epel repository for Redhat/CentOS 7.x
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- '{{ epel_rhel7 }}'
tags:
- epel
when: ansible_distribution_major_version is defined and ansible_distribution_major_version | version_compare('7', '>=')
#- name: Proactively remove qpid packages that cause yum update failures, ignore errors
# become: yes
# yum:
# name: '{{ item }}'
# state: absent
# with_items:
# - apigee-qpidd-*
# - qpid-*
# - python-qpid*
# - libqpid*
- name: Keep yum downloads small
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- deltarpm
- name: Speed up yum
become: yes
shell: yum makecache {{ item }}
with_items:
- yum-presto
- fast
- name: Update basic yum os packages
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- bind-utils
- chkconfig
- curl
- tar
- wget
- yum-utils
- unzip
- rsync
- which
- libselinux-python
- nss
- openssh-clients
- openssh-server
- sudo
- grep
- rpm
- rng-tools
- sed
- unzip
- name: Start rngd service
service:
name: rngd
enabled: yes
state: started
- name: Update vm.swappiness
become: yes
sysctl:
name: vm.swappiness
value: '{{ vm_swappiness }}'
state: present
tags:
- os_tuning
- name: Disable Default IPV6
become: yes
shell: "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
- name: Disable All IPV6
become: yes
shell: "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
- name: Update for apigee installation environment
become: yes
lineinfile:
dest: /etc/environment
regexp: "^export CONTINUE_ON_WARNING="
line: 'export CONTINUE_ON_WARNING={{ apigee_continue_on_warning }}'
backup: yes
- name: Add pip package manager
become: yes
get_url:
url: https://bootstrap.pypa.io/get-pip.py
dest: /tmp/get-pip.py
tags:
- pip
- name: Install pip package manager
become: yes
shell: python /tmp/get-pip.py
tags:
- pip
- name: Update python packages
become: yes
tags:
- pip
register: pip_status
pip:
name: '{{ item }}'
state: present
with_items:
- httplib2
- pexpect
- passlib
- requests
- kazoo