Skip to content

Commit 0241bdf

Browse files
committed
Initial support for EL7 (os-wise)
1 parent 4503c38 commit 0241bdf

File tree

6 files changed

+91
-21
lines changed

6 files changed

+91
-21
lines changed

roles/common/defaults/main.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Lab playbook - sets up the host specific shit
22
---
3-
epel_rpm: "http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
3+
4+
epel_rpm: "{% if ansible_distribution_major_version|int==6%}{{ epel6_rpm }}{%elif ansible_distribution_major_version|int==7 %}{{ epel7_rpm }}{% else %}None{% endif %}"
5+
epel7_rpm: http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
6+
epel6_rpm: http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
7+
ol_repo_file: "{% if ansible_distribution_major_version|int==6%}{{ ol6_repo_file }}{%elif ansible_distribution_major_version|int==7 %}{{ ol7_repo_file }}{% else %}None{% endif %}"
48
ol6_repo_file: public-yum-ol6.repo
9+
ol7_repo_file: public-yum-ol7.repo
510
repo_dir: /etc/yum.repos.d/
611
# default_user: ansible
712
install_os_packages: true
813
configure_epel_repo: true
914
configure_public_yum_repo: true
1015
configure_motd: true
1116
configure_ntp: true
12-
13-
common_packages:
17+
common_packages: "{% if ansible_distribution_major_version|int==6%}{{ common_packages_el6 }}{%elif ansible_distribution_major_version|int==7 %}{{ common_packages_el7 }}{% else %}None{% endif %}"
18+
common_packages_el6:
1419
- screen
1520
- facter
1621
- procps
@@ -25,7 +30,6 @@
2530
- unzip
2631
- openssh-clients
2732
- compat-libcap1
28-
- twm
2933
- collectl
3034
- rlwrap
3135
- tigervnc-server
@@ -39,6 +43,34 @@
3943
- python-devel
4044
- python-pip
4145
- libselinux-python
46+
- twm
47+
common_packages_el7:
48+
- screen
49+
- facter
50+
- procps
51+
- module-init-tools
52+
- ethtool
53+
- bc
54+
- nc
55+
- bind-utils
56+
- nfs-utils
57+
- make
58+
- sysstat
59+
- unzip
60+
- openssh-clients
61+
- compat-libcap1
62+
- collectl
63+
- rlwrap
64+
- tigervnc-server
65+
- ntp
66+
- expect
67+
- git
68+
- lvm2
69+
- xfsprogs
70+
- btrfs-progs
71+
- python-devel
72+
- python-pip
73+
- libselinux-python
4274

4375
common_packages_sles:
4476
- screen

roles/common/tasks/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
tags:
2525
- epelrepo
2626

27-
- name: Get newest repo-file for OL6 (public-yum)
28-
get_url: dest={{ repo_dir}}/{{ ol6_repo_file }} url=http://public-yum.oracle.com/{{ ol6_repo_file }} backup=yes
29-
when: configure_public_yum_repo and ansible_lsb.id == 'OracleServer' and ansible_lsb.major_release|int == 6
27+
- name: Get newest repo-file for OL (public-yum)
28+
get_url: dest={{ repo_dir}}/{{ ol_repo_file }} url=http://public-yum.oracle.com/{{ ol_repo_file }} backup=yes
29+
when: configure_public_yum_repo and ansible_distribution == 'OracleLinux'
3030
tags:
3131
- ol6repo
3232

3333
- name: Install common packages OL/RHEL
3434
yum: name={{ item }} state=installed
35-
with_items: "{{common_packages }}"
36-
when: install_os_packages and ansible_pkg_mgr=="yum"
35+
with_items: "{{ common_packages }}"
36+
when: install_os_packages and ansible_os_family == 'RedHat'
3737
tags:
3838
- commonpackages
39-
39+
4040
- name: Install common packages SLES12
4141
zypper: name={{ item }} state=installed
4242
with_items: "{{ common_packages_sles }}"
43-
when: install_os_packages and ansible_pkg_mgr=="zypper"
43+
when: install_os_packages and ansible_os_family == 'Suse'
4444
tags:
4545
- commonpackages
4646

roles/orahost/defaults/main.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
grid_users:
2424
- { username: grid, uid: 54320, primgroup: oinstall, othergroups: "asmadmin,asmdba,asmoper,dba", passwd: "$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0" }
2525

26+
firewall_service: "{% if ansible_distribution_major_version|int==6%}iptables{%elif ansible_distribution_major_version|int==7 %}firewalld{% else %}0{% endif %}"
2627
role_separation: false
2728
oracle_user: oracle # User that will own the Oracle Installations.
2829
grid_user: grid
@@ -44,9 +45,12 @@
4445
- /tmp/authorized_keys
4546
keyfile: /tmp/known_hosts
4647

47-
epel_rpm: "http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
48-
asmlib_rpm: "http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm"
49-
ol6_repo_file: public-yum-ol6.repo
48+
49+
#epel_rpm: "http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
50+
asmlib_rpm: "{% if ansible_distribution_major_version|int==6%}{{asmlib_rpm_el6}}{%elif ansible_distribution_major_version|int==7 %}{{asmlib_rpm_el7}}{% else %}None{% endif %}"
51+
asmlib_rpm_el6: "http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm"
52+
asmlib_rpm_el7: "http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm"
53+
#ol6_repo_file: public-yum-ol6.repo
5054
repo_dir: /etc/yum.repos.d/
5155

5256
disable_numa_boot: true # (true/false) Sets numa=off in grub.conf
@@ -62,7 +66,7 @@
6266
device_persistence: udev
6367
install_os_packages: true
6468
disable_selinux: true
65-
disable_iptables: true
69+
disable_firewall: true
6670

6771
configure_hugepages: true
6872
configure_hugepages_by: percentage # percentage/memory
@@ -139,7 +143,7 @@
139143
- sysstat
140144
- openssh-clients
141145
- compat-libcap1
142-
- twm
146+
#- twm
143147
- xorg-x11-xauth
144148
- xorg-x11-xinit
145149
- libXtst

roles/orahost/tasks/Redhat-6.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
3+
- name: Count number of kernel lines that needs to be changed (numa=off transparent_hugepage=never)
4+
shell: cat /etc/grub.conf | grep title |wc -l
5+
register: count
6+
tags: thpnuma
7+
8+
- name: Disable Transparent Hugepages (in grub.conf)
9+
lineinfile: dest=/etc/grub.conf
10+
backup=True
11+
backrefs=True
12+
state=present
13+
regexp='(^\s+kernel(\s+(?!transparent_hugepage=never)[\w=/\-\.]+)*)\s*$'
14+
line='\1 transparent_hugepage=never'
15+
with_sequence: start=0 end={{ count.stdout }}
16+
tags: thpnuma
17+
18+
- name: Disable Numa (in grub.conf)
19+
lineinfile: dest=/etc/grub.conf
20+
backup=True
21+
backrefs=True
22+
state=present
23+
regexp='(^\s+kernel(\s+(?!numa=off)[\w=/\-\.]+)*)\s*$'
24+
line='\1 numa=off'
25+
with_sequence: start=0 end={{ count.stdout }}
26+
tags: thpnuma
27+
when: disable_numa_boot
28+
29+
- name: Disable Transparent Hugepages (runtime)
30+
shell: if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled; fi;
31+
tags: tphnuma

roles/orahost/tasks/Redhat-7.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- name: Disable Transparent Hugepages (runtime)
2+
shell: if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled; fi;
3+
tags: tphnuma

roles/orahost/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
- name: Install packages required by Oracle for ASMlib on OL/RHEL
2424
yum: name={{ item }} state=installed
2525
with_items: "{{oracle_asm_packages}}"
26-
when: install_os_packages and device_persistence == 'asmlib' and ansible_os_family == 'RedHat'
26+
when: install_os_packages and device_persistence == 'asmlib' and ansible_os_family == 'RedHat'
2727
tags: os_packages, oscheck
2828

2929
- name: Install packages required by Oracle for ASMlib on SLES
3030
zypper: name={{ item }} state=installed
3131
with_items: "{{ oracle_asm_packages_sles }}"
32-
when: install_os_packages and device_persistence == 'asmlib' and ansible_os_family == 'Suse'
32+
when: install_os_packages and device_persistence == 'asmlib' and ansible_os_family == 'Suse'
3333
tags: os_packages, oscheck, asm1
3434

35-
- name: Disable iptables
36-
service: name=iptables state=stopped enabled=no
37-
when: disable_iptables and ansible_os_family == 'RedHat'
35+
- name: Disable firewall
36+
service: name={{ firewall_service }} state=stopped enabled=no
37+
when: disable_firewall and ansible_os_family == 'RedHat'
3838
tags: iptables
3939
register: iptables
4040

0 commit comments

Comments
 (0)