-
Notifications
You must be signed in to change notification settings - Fork 0
/
fedora_provision.yml
105 lines (88 loc) · 3.12 KB
/
fedora_provision.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
- name: Provision localhost Fedora
hosts: localhost
become: yes
tasks:
- name: autoremove, update cache
block:
- name: autoremove preinstalled packages
dnf:
autoremove: yes
- name: force dnf to check if cache is out of date
dnf:
update_cache: yes
- name: manage docker (remove if old, install latest)
shell: |
dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux \
docker-engine-selinux \
docker-engine
dnf -y install dnf-plugins-core
dnf -y config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
dnf -y install docker-ce docker-ce-cli containerd.io --allowerasing
dnf -y install docker-compose
- name: manage mongodb
block:
- name: create and populate mongodb.repo file
copy:
dest: "/etc/yum.repos.d/mongodb.repo"
content: |
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
- name: install mongodb
shell: |
dnf -y install mongodb-org
systemctl daemon-reload
- name: install wget, git, terminator
dnf:
name:
- wget
- git
- terminator
state: latest
- name: install vagrant and virtualbox
shell: lscpu | grep Virtualization
register: virtualization_extension
- name: install VirtualBox
shell: |
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
mv virtualbox.repo /etc/yum.repos.d/virtualbox.repo
dnf install -y VirtualBox*
/usr/lib/virtualbox/vboxdrv.sh setup
when: virtualization_extension.stdout != ""
- name: install vagrant
shell: dnf -y install vagrant
- name: install nodejs
dnf:
name: nodejs
state: latest
- name: install java tools
dnf:
name: maven
state: latest
- name: install mysql
shell: |
dnf -y install https://dev.mysql.com/get/mysql80-community-release-fc35-2.noarch.rpm
dnf -y install mysql-community-server
- name: install kubectl
shell: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: install minikube
shell: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
install minikube-linux-amd64 /usr/local/bin/minikube
- name: generate ssh keypair
openssh_keypair:
path: /tmp/fedora_id_ed25519
size: 4096
type: ed25519
- name: upgrade all packages
dnf:
name: "*"
state: latest
- name: clean dnf packages
shell: dnf -y clean packages