Initial commit
This commit is contained in:
47
roles/oracle-db-preinstall/tasks/users_configuration.yml
Normal file
47
roles/oracle-db-preinstall/tasks/users_configuration.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
# ---------------------------------------------------
|
||||
# CRéation des groupes
|
||||
# ---------------------------------------------------
|
||||
- name: Création des groupes
|
||||
group: name={{ item.group }} gid={{ item.gid }} state=present
|
||||
with_items:
|
||||
- { group: oinstall, gid: 1001}
|
||||
- { group: dba, gid: 1002 }
|
||||
- { group: oper, gid: 1003 }
|
||||
- { group: backupdba, gid: 1004 }
|
||||
- { group: dgdba, gid: 1005 }
|
||||
- { group: kmdba, gid: 1006 }
|
||||
- { group: racdba, gid: 1007 }
|
||||
- { group: asmadmin, gid: 1008 }
|
||||
- { group: asmdba, gid: 1009 }
|
||||
- { group: asmoper, gid: 1010 }
|
||||
ignore_errors: true
|
||||
when: full_configuration |bool
|
||||
tags: group
|
||||
|
||||
# ---------------------------------------------------
|
||||
# Création des utilisateurs : password Oracle123 => full configuration
|
||||
# ---------------------------------------------------
|
||||
- name: Création du compte Oracle et grid
|
||||
user:
|
||||
name={{ item.username }} group={{ item.primgroup }}
|
||||
groups={{ item.othergroups }} uid={{ item.uid }}
|
||||
generate_ssh_key=yes append=yes state=present update_password=on_create password={{ item.passwd }}
|
||||
with_items:
|
||||
- { username: oracle, uid: 1001, primgroup: oinstall, othergroups: "dba,oper,backupdba,dgdba,kmdba,racdba", passwd: "$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0"}
|
||||
- { username: grid, uid: 1002, primgroup: oinstall, othergroups: "dba,asmdba,asmoper,asmadmin,racdba", passwd: "$6$0xHoAXXF$K75HKb64Hcb/CEcr3YEj2LGERi/U2moJgsCK.ztGxLsKoaXc4UBiNZPL0hlxB5ng6GL.gyipfQOOXplzcdgvD0"}
|
||||
ignore_errors: true
|
||||
when: full_configuration |bool
|
||||
tags: user
|
||||
|
||||
|
||||
# ---------------------------------------------------
|
||||
# Ajout du compte oracle et grid au sudoers
|
||||
# ---------------------------------------------------
|
||||
- name: Ajout du compte oracle et grid au sudoers
|
||||
ignore_errors: true
|
||||
template: src=sudoers.j2 dest=/etc/sudoers.d/{{ item }} owner=root mode=0600
|
||||
with_items:
|
||||
- oracle
|
||||
- grid
|
||||
tags: sudoadd
|
||||
Reference in New Issue
Block a user