- name : auto_oracle_as_root
remote_user: root
hosts: localhost
vars:
epic: true
tasks:
- name: add_group_oinstall
group:
name={{ item }}
state=present
with_items:
- oinstall
- dba
- name: add user
user:
name=oracle
group=oinstall
groups=dba
home=/home/oracle
uid=700
password={{ password }}
- name: test os
shell: echo "only on Red Hat 6, derivatives, and later"
when: ansible_os_family == "Centos"
- name: test epic
shell: echo "This certainly is epic!"
when: epic
- name: test not epic
shell: echo "This certainly is not epic!"
when: not epic
- name: modify /etc/security/limits.conf
lineinfile:
path=/etc/security/limits.conf
line={{item}}
state=present
with_items:
- ‘oracle soft nproc 2047‘
- ‘oracle hard nproc 16384‘
- ‘oracle soft nofile 1024‘
- ‘oracle hard nofile 65536‘
- name: run some shell command
command: echo {{ item }}
with_items: [0,1,2,3,4,5,6,7]
when: item > 5