-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.cloud-init.yaml
164 lines (154 loc) · 4.44 KB
/
example.cloud-init.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#cloud-config
write_files:
- path: /etc/cron.daily/apt-check
content: |
apt-get update -qq
apt-get upgrade -ydqq
- path: /etc/skel/.bashrc
content: |
#
case $- in
*i*) ;;
*) return;;
esac
set -o noclobber
bind Space:magic-space
shopt -s globstar 2> /dev/null
bind "set completion-ignore-case on"
bind "set completion-map-case on"
bind "set show-all-if-ambiguous on"
HISTCONTROL=ignoreboth
shopt -s histappend
shopt -s cmdhist
PROMPT_COMMAND='history -a'
HISTSIZE=8000
HISTFILESIZE=40000
shopt -s checkwinsize
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
bind '"\e[C": forward-char'
bind '"\e[D": backward-char'
CDPATH="."
shopt -s cdable_vars
export VISUAL=nano
export EDITOR=nano
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
export PATH="$PATH:$HOME/.config/composer/vendor/bin:$HOME/.gem/ruby/2.6.0/bin:$HOME/.gem/ruby/2.7.0/bin"
export PATH="$HOME/.poetry/bin:$PATH"
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
stty -ixon -ixoff
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
color_prompt=yes
if [ "$color_prompt" = yes ]; then
PS1="${debian_chroot:+($debian_chroot)}\[\033[38;5;7m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;37m\]\u\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput bold)\]\\[\033[38;5;208m\]\h\[$(tput sgr0)\]\[$(tput bold)\]\\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;10m\]\\$\[$(tput sgr0)\]"
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
- path: /etc/gitconfig
content: |
#
[push]
default = simple
[pull]
rebase = true
[user]
email = yourmail@domain
name = you
[alias]
ci=commit
st=status
co=checkout
ad=add -A
di=diff
br=branch
cp=cherry-pick
log2=log --graph --oneline --decorate
it = !git init && git commit -m “root” --allow-empty
commend = commit --amend --no-edit
apt:
sources:
docker.list:
source: deb [arch=amd64] https://download.docker.com/linux/debian $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
apt_update: true
apt_upgrade: true
groups:
- cloud-users
- docker
users:
- name: vmail
system: true
homedir: /var/vmail/
groups: vmail
- default
- name: you
gecos: you
shell: /bin/bash
primary_group: you
groups: sudo, docker, cloud-users, vmail
lock_passwd: false
passwd: $6$bzzbzzbzzzzzzz.
packages:
- ca-certificates
- apt-transport-https
- gnupg-agent
- software-properties-common
- curl
- rsync
- telnet
- sudo
- byobu
- iptables-persistent
- ntp
- git
- python3
- postfix-doc
- opendkim-tools
- bind9-utils
- mariadb-client
- docker-ce
- docker-ce-cli
- containerd.io
runcmd:
- systemctl daemon-reload
- mkdir /home/you/.ssh/
- cp /root/.ssh/authorized_keys /home/you/.ssh/authorized_keys
- chown -R you:you /home/you/
- systemctl enable docker
- systemctl start docker
phone_home:
url: https://changeme-infra-phonehome.functions.fnc.fr-par.scw.cloud
post: all
tries: 10