-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian-my-defaultpackages.yml
85 lines (80 loc) · 2.39 KB
/
debian-my-defaultpackages.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
# _ __ _ _ ____ _
# | |/ /__ ___ ____ _(_|_) _ \ __ _ _ __ | |_ ___ _ _
# | ' // _` \ \ /\ / / _` | | | |_) / _` | '_ \| __/ __| | | |
# | . \ (_| |\ V V / (_| | | | __/ (_| | | | | |_\__ \ |_| |
# |_|\_\__,_| \_/\_/ \__,_|_|_|_| \__,_|_| |_|\__|___/\__,_|
# ____ _ _ _
# [ ANSIBLE ] | _ \| | __ _ _ _| |__ ___ ___ | | _____
# Please only use | |_) | |/ _` | | | | '_ \ / _ \ / _ \| |/ / __|
# playbooks if | __/| | (_| | |_| | |_) | (_) | (_) | <\__ \
# you know what |_| |_|\__,_|\__, |_.__/ \___/ \___/|_|\_\___/
# they change/do |___/
#
# .---------| My "default packages" that is install on any lxc/vm
# |
# | This playbook will do the following:
# | - Update apt cache
# | - Do apt-get install (package list)
# | - If propper VM (not LxC) also install QEMU Guest Agent
# `---------------------------------------------------------------
---
- hosts: debian
tasks:
- name: Check if platform is Virtual
lineinfile:
dest: /sys/devices/virtual/dmi/id/sys_vendor
line: "QEMU"
check_mode: yes
register: virtual
failed_when: (virtual is changed) or (virtual is failed)
ignore_errors: true
- name: Check if platform is Physical
set_fact:
physical: true
virtual: false
when: virtual is changed
- name: Set fact for Virtual
set_fact:
physical: false
virtual: true
when: virtual
- name: Install default packages for all my lxc/vm hosts
register: updatesys
apt:
update_cache: yes
force_apt_get: yes
name:
- lsb-release
- rsyslog
- aptitude
- debian-goodies
- nano
- vim
- wget
- curl
- w3m
- ftp
- ftp-ssl
- net-tools
- netcat-traditional
- tcpdump
- tshark
- zsh
- ca-certificates
- cowsay
- figlet
- neofetch
- htop
- bpytop
- mc
- jq
state: latest
- name: Install QEMU Guest Agent on propper VM's
register: updatesys
apt:
update_cache: yes
force_apt_get: yes
name:
- qemu-guest-agent
state: latest
when: virtual