-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_basics.yml
33 lines (25 loc) · 1.01 KB
/
check_basics.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
---
- hosts: all
remote_user: root
tasks:
# - name: Ensure /etc/hosts exists and mode=0644
# file: path=/etc/hosts mode=0644 state=file
- name: Ensure /etc/hostname exists and mode=0644
file: path=/etc/hostname mode=0644 state=file
- name: Ensure consistent /etc/hostname
template: src=/etc/ansible/templates/hosts.j2 dest=/etc/hosts mode=0644 owner=root group=root
- name: Ensure media user exists
user: name=media comment="Media User" uid=20000 shell=/bin/bash generate_ssh_key=yes
- name: Ensure user belongs to group
user: user=media groups=projectx append=yes
- name: Check if SELinux is set to ENFORCING on redhat systems
selinux: policy=targeted state=enforcing
when: ansible_os_family=="RedHat"
# Check if ntpd is ruuning and run ntp date or not
- name: Check ntpdata
shell: ps -fC ntpd
register: ntpd_present
ignore_errors: True
- name: SYNC Time
shell: "ntpdate {{ntp_server}}"
when: ntpd_present is failed