import du dossier ansible
This commit is contained in:
10
roles/common/README.md
Normal file
10
roles/common/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
common
|
||||
=========
|
||||
|
||||
Update system, install base packages, configure system ...
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
This role just needs to have an email defined in vars
|
||||
|
||||
31
roles/common/defaults/main.yml
Normal file
31
roles/common/defaults/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
commonRequirePackages:
|
||||
- htop
|
||||
- vim
|
||||
- man
|
||||
- bash-completion
|
||||
- locales
|
||||
- python-pip
|
||||
- wget
|
||||
- bzip2
|
||||
- lsof
|
||||
- sudo
|
||||
- tree
|
||||
- ccze
|
||||
- vim-common
|
||||
- tmux
|
||||
- curl
|
||||
- git
|
||||
- unzip
|
||||
- ufw
|
||||
|
||||
commonDeletePackages:
|
||||
- bind9
|
||||
- telnet
|
||||
- ftp
|
||||
|
||||
locales: "fr_FR.UTF-8"
|
||||
|
||||
# Timezone
|
||||
Area : Europe
|
||||
City: Paris
|
||||
51
roles/common/tasks/main.yml
Normal file
51
roles/common/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Update & upgrade system
|
||||
apt:
|
||||
update_cache: yes
|
||||
upgrade: dist
|
||||
|
||||
- name: Install common required packages
|
||||
apt:
|
||||
name: "{{ commonRequirePackages }}"
|
||||
|
||||
|
||||
- name: Remove useless stuff
|
||||
apt:
|
||||
name: "{{ commonDeletePackages }}"
|
||||
state: absent
|
||||
|
||||
- name: Set the hostname
|
||||
hostname:
|
||||
name: "{{ cthostname }}"
|
||||
|
||||
- name: Set locales
|
||||
locale_gen:
|
||||
name: "{{ locales }}"
|
||||
state: present
|
||||
|
||||
- name: Set the Timezone to {{ Area }}/{{ City }}
|
||||
shell: "ln -sf /usr/share/zoneinfo/{{ Area}}/{{ City }} /etc/localtime"
|
||||
|
||||
- name: Fix /etc/hosts removing the old hostname
|
||||
tags:
|
||||
- hosts
|
||||
lineinfile:
|
||||
state: present
|
||||
dest: /etc/hosts
|
||||
line: "{{ ansible_default_ipv4.address }} {{ cthostname }} {{ domain }}"
|
||||
regexp: "^{{ ansible_default_ipv4.address }}"
|
||||
|
||||
- name: Allow SSH connexions
|
||||
ufw:
|
||||
rule: limit
|
||||
port: ssh
|
||||
proto: tcp
|
||||
|
||||
- name: Set logging off
|
||||
ufw:
|
||||
logging: 'off'
|
||||
|
||||
- name: Deny everything and enable UFW
|
||||
ufw:
|
||||
state: enabled
|
||||
policy: deny
|
||||
Reference in New Issue
Block a user