Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CICD 2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Clément Charlier
CICD 2022
Commits
941186d1
Commit
941186d1
authored
2 years ago
by
Florentin Labelle
Browse files
Options
Downloads
Patches
Plain Diff
Fix deployment
parent
00cbc19b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
vms/README.md
+8
-4
8 additions, 4 deletions
vms/README.md
vms/cloudinit.py
+0
-26
0 additions, 26 deletions
vms/cloudinit.py
vms/cloudinit.yaml
+21
-0
21 additions, 0 deletions
vms/cloudinit.yaml
with
29 additions
and
30 deletions
vms/README.md
+
8
−
4
View file @
941186d1
...
...
@@ -4,9 +4,6 @@
1.
Les faire papser
2.
Figer le paps 10-15 mins avant le tp de déploiment
3.
Exporter en csv
4.
Mettre le résultat dans le paps.csv
5.
Lancer le cloudinit.py
## Création des vms
...
...
@@ -26,4 +23,11 @@
-
`source openrc`
-
récupérer les ips
-
`openstack server list --project formation -f yaml | yq ".[].Networks.vm[1]"`
-
les copier dans un fichier vscode, puis attribuer une vm à chaque mec en mode tu prends le numéro de ton paps et l'ip de la ligne associé.
-
Appeler Marc-Antoine ou Quentin si ça marche pas
-
les copier dans un fichier vscode, puis attribuer une vm à chaque mec en mode tu prends le numéro de son paps et l'ip de la ligne associé.
## Se connecter à une vm
-
attendre 1-2 min que le cloud-init s'execute
-
user: viazero
mdp: viazero
This diff is collapsed.
Click to expand it.
vms/cloudinit.py
deleted
100644 → 0
+
0
−
26
View file @
00cbc19b
"""
Generate cloud-init configuration for the VMs.
"""
import
crypt
cloudinit
=
"""
#cloud-config
apt_upgrade: true
ssh_pwauth: 1
users:
"""
with
open
(
"
paps.csv
"
,
encoding
=
"
utf-8
"
)
as
file
:
for
line
in
file
.
readlines
()[
1
:]:
login
=
line
.
split
(
"
;
"
)[
0
][
4
:]
password
=
crypt
.
crypt
(
login
,
crypt
.
mksalt
(
crypt
.
METHOD_SHA256
))
cloudinit
+=
f
"""
- name:
{
login
}
primary_group:
{
login
}
groups: users
lock_passwd: false
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
passwd:
{
password
}
"""
with
open
(
"
cloudinit.yaml
"
,
"
w
"
,
encoding
=
"
utf-8
"
)
as
file
:
file
.
write
(
cloudinit
)
This diff is collapsed.
Click to expand it.
vms/cloudinit.yaml
+
21
−
0
View file @
941186d1
#cloud-config
apt_upgrade
:
true
ssh_pwauth
:
1
runcmd
:
-
apt install -y zsh curl python3-pip git ca-certificates fail2ban
-
mkdir -p /etc/zsh
-
git clone https://github.com/robbyrussell/oh-my-zsh.git /etc/zsh/.oh-my-zsh
-
mkdir -p /etc/zsh/.oh-my-viarezo
-
git clone https://gitlab.viarezo.fr/ViaRezo/oh-my-viarezo.git /etc/zsh/.oh-my-viarezo/themes/oh-my-viarezo
-
git clone https://gitlab.viarezo.fr/ViaRezo/zsh-plugins.git /etc/zsh/.oh-my-viarezo/plugins
-
curl https://gitlab.viarezo.fr/-/snippets/40/raw/main/zshrc > /etc/zsh/zshrc
-
chsh -s /bin/zsh
-
touch /root/.zshrc
-
touch /home/viazero/.zshrc
users
:
-
name
:
viazero
primary_group
:
viazero
lock_passwd
:
false
shell
:
/bin/zsh
sudo
:
ALL=(ALL) NOPASSWD:ALL
passwd
:
$5$mPCaWrI78yDsgbTd$ipZkGn/CAuo4A9Y9fO21C6CcW2JmrzI100XD9xSCHE1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment