-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinitial_playbook.yml
40 lines (32 loc) · 1.28 KB
/
initial_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
---
- hosts: all
name: Initialize server for Ansible
gather_facts: false
vars:
ansible_become_pass: "{{ host_admin_password }}"
ansible_user: "{{ host_admin_user }}"
ansible_password: "{{ host_admin_password }}"
ansible_port: 22
pre_tasks:
- name: Initial packages update using raw module
ansible.builtin.raw: apt-get update -y
tags: raw-debian
- name: Initial packages upgrade using raw module
ansible.builtin.raw: apt-get upgrade -y --no-install-recommends
tags: raw-debian
- name: Initial python installation using raw module
ansible.builtin.raw: apt-get install -y python3 python3-apt python3-simplejson aptitude --no-install-recommends
tags: raw-debian
- name: Initial packages update using raw module
ansible.builtin.raw: yum update -y
tags: raw-redhat
- name: Initial packages upgrade using raw module
ansible.builtin.raw: yum upgrade -y
tags: raw-redhat
- name: Initial python installation using raw module
ansible.builtin.raw: yum install -y libselinux-python3 python3 python3-simplejson aptitude
tags: raw-redhat
- name: Gathering facts
ansible.builtin.setup:
roles:
- { role: init_server, tags: init }