-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrhel-configuration-ansible-playbook.yml
95 lines (82 loc) · 2.14 KB
/
rhel-configuration-ansible-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
- hosts: all
gather_facts: false
become: yes
tasks:
- name: Install subscription manager
yum:
name: subscription-manager
state: present
update_cache: true
- name: Unregister cloud machines
community.general.redhat_subscription:
state: absent
- name: Register with activationkey and consume subscriptions
community.general.redhat_subscription:
state: present
activationkey: packer-rhel
org_id: 13679583
# auto_attach: true
- name: Add group "rheladmins" to remote server
group:
name: rheladmins
gid: 2010
state: present
- name: Add group "dev" to remote server
group:
name: dev
gid: 2011
state: present
- name: Add group "test" to remote server
group:
name: test
gid: 2012
state: present
- name: Add user "sysadmin" to remote server
user:
name: sysadmin
comment: "Privileged User"
uid: 2001
group: rheladmins
groups: test,dev
append: yes
shell: /bin/bash
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: Add user "Owain" to remote server
user:
name: owain
comment: "Accountant UnPrivileged User"
uid: 2002
group: test
shell: /bin/bash
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: Add user "Max" to remote server
user:
name: max
comment: "Content creator UnPrivileged User"
uid: 2003
group: dev
shell: /bin/bash
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: latest Apache version installed
yum:
name:
- httpd
- firewalld
state: present
- name: Apache enabled and running
service:
name: httpd
enabled: true
state: started
- name: Firewall opened for port 80/tcp
firewalld:
port: 80/tcp
permanent: true
state: enabled