108 lines
2.6 KiB
YAML
108 lines
2.6 KiB
YAML
---
|
|
|
|
- name: (basic.yml) Ensure timezone is is correct
|
|
timezone: name={{ time_zone }}
|
|
tags:
|
|
- timezone
|
|
|
|
|
|
- name: (basic.yml) Ensure locales are present
|
|
locale_gen:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items: "{{ locales }}"
|
|
tags:
|
|
- locales
|
|
|
|
- name: (basic.yml) Create a symbolic link /bin/sh -> bash
|
|
file:
|
|
src: bash
|
|
dest: /bin/sh
|
|
owner: root
|
|
group: root
|
|
state: link
|
|
tags:
|
|
- symlink-sh
|
|
|
|
- name: (basic.yml) Ensure directory '/etc/systemd/system.conf.d' exists
|
|
file:
|
|
path: /etc/systemd/system.conf.d
|
|
state: directory
|
|
mode: 0755
|
|
group: root
|
|
owner: root
|
|
when:
|
|
- inventory_hostname not in groups['lxc_guest']
|
|
- copy_plain_files_systemd is defined
|
|
- copy_plain_files_systemd|length > 0
|
|
tags:
|
|
- systemd-config
|
|
|
|
- name: (basic.yml) Ensure files /etc/systemd/system.conf.d/*.conf exists
|
|
copy:
|
|
src: '{{ item.src_path }}'
|
|
dest: '{{ item.dest_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
loop: "{{ copy_plain_files_systemd }}"
|
|
loop_control:
|
|
label: 'dest: {{ item.name }}'
|
|
when:
|
|
- inventory_hostname not in groups['lxc_guest']
|
|
- copy_plain_files_systemd is defined
|
|
- copy_plain_files_systemd|length > 0
|
|
tags:
|
|
- systemd-config
|
|
|
|
- name: (basic.yml) Ensure directory '/etc/sysctl.d' exists
|
|
file:
|
|
path: etc/sysctl.d
|
|
state: directory
|
|
mode: 0755
|
|
group: root
|
|
owner: root
|
|
when:
|
|
- inventory_hostname not in groups['lxc_guest']
|
|
- copy_plain_files_sysctl is defined
|
|
- copy_plain_files_sysctl|length > 0
|
|
tags:
|
|
- systctl-config
|
|
|
|
- name: (basic.yml) Ensure files /etc/sysctl.d/*.conf exists
|
|
copy:
|
|
src: '{{ item.src_path }}'
|
|
dest: '{{ item.dest_path }}'
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
loop: "{{ copy_plain_files_sysctl }}"
|
|
loop_control:
|
|
label: 'dest: {{ item.name }}'
|
|
when:
|
|
- inventory_hostname not in groups['lxc_guest']
|
|
- copy_plain_files_sysctl is defined
|
|
- copy_plain_files_sysctl|length > 0
|
|
tags:
|
|
- systctl-config
|
|
|
|
#- name: (basic.yml) Check file '/etc/systemd/system.conf' exists
|
|
# stat:
|
|
# path: /etc/systemd/system
|
|
# register: etc_systemd_system_conf
|
|
# when:
|
|
# - set_default_limit_nofile|bool == true
|
|
#
|
|
#- name: (basic.yml) Change DefaultLimitNOFILE to 1048576
|
|
# lineinfile:
|
|
# dest: /etc/systemd/system.conf
|
|
# state: present
|
|
# regexp: '^DefaultLimitNOFILE'
|
|
# line: 'DefaultLimitNOFILE=1048576'
|
|
# insertafter: '^#DefaultLimitNOFILE'
|
|
# when:
|
|
# - set_default_limit_nofile|bool == true
|
|
# - etc_systemd_system_conf.stat.exists == true
|
|
# tags:
|
|
# - systemd-nofiles
|