Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit bdd55e0b authored by freezed's avatar freezed :mountain:
Browse files

:twisted_rightwards_arrows: Merge branch 'user'

parents 4cad378e c6bdf9cb
No related branches found
No related tags found
No related merge requests found
Showing
with 132 additions and 104 deletions
......@@ -21,10 +21,12 @@
- name: SUDO | User presence (with groups)
become: true
ansible.builtin.user:
append: true
groups: sudo
name: "{{ my_user }}"
shell: "{{ user_shell }}"
state: present
groups: sudo
append: true
uid: 1000
- name: SUDO | Reset ansible connection to apply group update
become: true
......
# ############################################# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# https://lab.frogg.it/freezed/ansible-debian #
# ############################################# #
USAGE_FILE=/var/.usage
lsb_release -d | sed 's/Description:/-=VERSION=-\t/g'
echo -e "-=UPTIME=-\t $(uptime)\n"
echo -e "-=WHOisHERE=-\n $(w)\n"
echo -e "\n-=IPs=-\n $(ip -br address|grep UP)\n"
echo -e "-=SCREEN=-\n $(screen -list)"
echo -e "-=DISKSPACE=-"
[[ -n $(zpool list) ]] &> /dev/null && zpool list -o name,size,free,frag,cap,health || df -h -t ext4 --output=source,used,avail,target
echo -e "\n-=USAGE=-"
[[ -e $USAGE_FILE ]] && cat ${USAGE_FILE} || echo "Usage unknown"
# ############################################# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# https://lab.frogg.it/freezed/ansible-debian #
# ############################################# #
# Ensure the remote shell produces no output for non-interactive sessions
# ############################################# #
# ~/.gitconfig #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
[color]
......@@ -23,7 +18,8 @@
fp = fetch --prune
lga = log --graph --oneline --decorate --since=10days --all
lgla = log --graph --oneline --decorate --date=short --all
lg = log --graph --oneline --decorate --since=10days
lg1 = log --max-count=1 --stat
lg2 = log --max-count=2 --stat
st = status
[mergetool]
......@@ -37,6 +33,9 @@
[checkout]
defaultRemote=origin
[url "ssh://git@git.afpy.org/"]
pushInsteadOf = https://git.afpy.org/
[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
......
# ############################################# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# https://lab.frogg.it/freezed/ansible-debian #
# ############################################# #
echo "DEBUG: I am .profile"
" """"""""""""""""""""""""""""""""""""""""""""" "
" ~/.vimrc "
" "
" This file is managed by Ansible "
" Manual edition will be overridden "
" "
" https://lab.frogg.it/freezed/ansible-debian "
" http://formation-debian.via.ecp.fr/ "
" "
" """"""""""""""""""""""""""""""""""""""""""""" "
" ':help options.txt' ou ':help nom_du_paramètre' dans Vim
......
# ############################################# #
# ~/.zlogin #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
USAGE_FILE=/var/.usage
......
# ############################################# #
# ~/.zlogout #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
echo "Exiting ${HOSTNAME}…"
# ############################################# #
# ~/.zshenv #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
export PATH="/usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/sbin:$HOME/bin:$HOME/.local/bin"
......
# ############################################# #
# ~/.zshrc #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# from http://formation-debian.via.ecp.fr #
# #
# ############################################# #
......@@ -35,12 +29,10 @@ function gh() { grep --color "$1" ~/.history }
alias ada='sudo apt update && sudo apt list --upgradable && sudo apt clean'
alias agr='sudo apt upgrade && sudo apt autoclean && sudo apt autoremove'
alias apti='sudo apt install'
alias p1='ping -c 1 '
alias gps='for proj in $(find ~/git -mindepth 1 -maxdepth 1 -type d -printf "%p\n");do RES=$(git -C ${proj} status -s) && [[ -n ${RES} ]] && echo "\n# ${proj#${HOME}/git/}:\n${RES}";done'
alias gpu='for proj in $(find ~/git -mindepth 1 -maxdepth 1 -type d -printf "%p\n");do git -C ${proj} fetch --prune --quiet || echo "ERROR fetching git repo: ${proj#${HOME}/git/}";done'
alias p1='ping -c 1 '
alias sudo='sudo '
alias ttoday='cat ~/.timed|grep "$(date +%d) Oct 2021" | timed parse'
alias vact='source ~/.venvs/$(pwd | cut -d"/" -f5)/bin/activate'
alias vc10='~/pylocal/bin/python3.10 -m venv --clear --copies ~/.venvs/$(pwd | cut -d "/" -f5)'
alias vc='python3 -m venv --clear --copies ~/.venvs/$(pwd | cut -d "/" -f5)'
......@@ -49,7 +41,7 @@ alias vdestroy='VENV_PATH="${HOME}/.venvs/$(pwd | cut -d"/" -f5)/" && echo ${VEN
# Timed
alias tart='timed start _job_;vi ~/.timed +'
alias tsto='timed stop;ttod'
alias ttod='cat ~/.timed | grep "$(date +%d) Jan 2022" | timed parse'
alias ttod='cat ~/.timed | grep "$(date +%d) Jan 2023" | timed parse'
# ######################### #
......@@ -194,7 +186,7 @@ unsetopt hup
# ########################################### #
setopt EXTENDED_HISTORY
export HISTTIMEFORMAT="[%F %T] "
#export HISTTIMEFORMAT="[%F %T] "
# Nombre d'entrées dans l'historique
export HISTORY=50000
......
......@@ -6,7 +6,16 @@
tasks:
- name: "IMPORT_TASKS | root"
- name: USER CONFIG | install zsh
when: inventory_hostname in groups.workstat
ansible.builtin.apt:
cache_valid_time: 3600
force_apt_get: true
pkg: zsh
state: present
update_cache: true
- name: IMPORT_TASKS | root
ansible.builtin.import_tasks: root.yml
- name: "IMPORT_TASKS | {{ my_user }}"
......
---
- name: MY USER | set user
become: no
ansible.builtin.user:
name: "{{ my_user }}"
shell: "{{ user_shell }}"
state: present
uid: 1000
- name: MY USER | dotfiles
become: yes
become: true
ansible.builtin.copy:
src: "{{ item }}"
dest: "/home/{{ my_user }}/.{{ item | basename }}"
......@@ -14,15 +21,43 @@
label: "{{ item | basename }}"
- name: MY USER | ssh config
become: yes
become: true
ansible.builtin.template:
dest: "/home/{{ my_user }}/.ssh/config"
src: templates/ssh_config.j2
src: templates/ssh-config.j2
mode: 0640
- name: MY USER | git directory presence
become: yes
- name: "MY USER | authorized_key for «{{ my_user }}»"
become: true
ansible.builtin.authorized_key:
comment: "Managed by Ansible"
key: https://gitlab.com/free_zed.keys
state: present
user: "{{ my_user }}"
- name: MY USER | osm cache dir presence
become: true
when: inventory_hostname in groups.station
ansible.builtin.file:
group: "{{ my_user }}"
mode: '0750'
owner: "{{ my_user }}"
path: "/home/{{ my_user }}/.osm-tiles/"
state: directory
- name: MY USER | gps prune config
become: true
when: inventory_hostname in groups.station
ansible.builtin.template:
src: templates/pruneconfig.j2
dest: "/home/{{ my_user }}/.pruneconfig"
owner: "{{ my_user }}"
group: "{{ my_user }}"
mode: '0640'
- name: MY USER | git directory presence
become: true
when: inventory_hostname in groups.workstat
ansible.builtin.file:
group: "{{ my_user }}"
mode: '0750'
......@@ -31,38 +66,18 @@
state: directory
- name: INCLUDE_VARS | git
when: inventory_hostname in groups.station
when: inventory_hostname in groups.workstat
ansible.builtin.include_vars: "vars/git.yml"
- name: MY USER | clone git repos
become: yes
when: inventory_hostname in groups.station
become: true
when: inventory_hostname in groups.workstat
ansible.builtin.git:
dest: "/home/{{ my_user }}/git/{{ item.local_name }}"
repo: "{{ item.url_https }}"
remote: "origin"
update: no
accept_hostkey: yes
accept_hostkey: true
with_items: "{{ git_repositories }}"
loop_control:
label: "{{ item.local_name }}"
- name: MY USER | osm cache dir presence
become: yes
when: inventory_hostname in groups.station
ansible.builtin.file:
group: "{{ my_user }}"
mode: '0750'
owner: "{{ my_user }}"
path: "/home/{{ my_user }}/.osm-tiles/"
state: directory
- name: MY USER | gps prune config
become: yes
when: inventory_hostname in groups.station
ansible.builtin.template:
src: templates/pruneconfig.j2
dest: "/home/{{ my_user }}/.pruneconfig"
owner: "{{ my_user }}"
group: "{{ my_user }}"
mode: '0640'
---
- name: ROOT | set user
become: no
ansible.builtin.user:
name: root
shell: "{{ user_shell }}"
state: present
- name: ROOT | dotfiles
become: no
......@@ -13,9 +19,18 @@
loop_control:
label: "{{ item | basename }}"
- name: ROOT | set zsh for shell
- name: ROOT | ssh config
when: inventory_hostname not in groups.station
become: no
ansible.builtin.user:
name: root
shell: /bin/zsh
ansible.builtin.template:
dest: "/root/.ssh/config"
src: templates/ssh-config.j2
mode: 0640
- name: ROOT | local public key
become: no
ansible.builtin.authorized_key:
comment: "Managed by Ansible"
key: https://gitlab.com/free_zed.keys
state: present
user: root
# ############################################# #
# GpsPrune config file #
# ~/.pruneconfig #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
prune.unitsetkey=unitset.kilometres
......
#jinja2:lstrip_blocks: True
# ############################################# #
# SSH config file #
# ~/.ssh/config #
# #
# This file is managed by Ansible #
# Manual edition will be overridden #
# #
# https://lab.frogg.it/freezed/ansible-debian #
# #
# ############################################# #
{% for host in groups['all'] %}
......
---
git_repositories:
- {local_name: "afpy19", url_https: "https://gitlab.com/free_zed/afpy19.git"}
- {local_name: "askthom", url_https: "https://lab.frogg.it/fcode/askthom.git"}
- {local_name: "djlease", url_https: "https://gitlab.com/free_zed/djlease.git"}
- {local_name: "delarte", url_https: "https://git.afpy.org/fcode/delarte.git"}
- {local_name: "eb-car", url_https: "https://gitlab.com/combien-de-temps-pour-faire-sonner-la-cloche-a-aiguebelle/combien-de-temps-pour-faire-sonner-la-cloche-a-aiguebelle.gitlab.io.git"}
- {local_name: "exchange", url_https: "https://gitlab.com/free_zed/mymsesb.git"}
- {local_name: "forga-a14n", url_https: "https://gitlab.com/free_zed/djbp.git"}
- {local_name: "forga-core", url_https: "https://gitlab.com/forga/tool/django/core.git"}
- {local_name: "forga-dev-bpy", url_https: "https://gitlab.com/forga/devel/boilerplate/python.git"}
- {local_name: "forga-emb", url_https: "https://gitlab.com/forga/process/fr/embarquement.git"}
- {local_name: "forga-glio", url_https: "https://gitlab.com/forga/forga.gitlab.io.git"}
- {local_name: "forga-man", url_https: "https://gitlab.com/forga/process/fr/manuel.git"}
- {local_name: "forga-tool-debian", url_https: "https://lab.frogg.it/fcode/ansible/debian.git"}
- {local_name: "forga-dev-bpy", url_https: "https://git.afpy.org/fcode/boilerplate-python.git"}
- {local_name: "forga-tool-debian", url_https: "https://lab.frogg.it/freezed/ansible-debian.git"}
- {local_name: "freezed.gl.io", url_https: "https://gitlab.com/free_zed/free_zed.gitlab.io.git"}
- {local_name: "ftalk-gitlab", url_https: "https://gitlab.com/ftalk/2020-gitlab.git"}
- {local_name: "ftalk-zfs", url_https: "https://gitlab.com/ftalk/openzfs.git"}
- {local_name: "geostrapy", url_https: "https://lab.frogg.it/fcode/geostrapy.git"}
- {local_name: "gpxpy", url_https: "https://github.com/freezed/gpxpy.git"}
- {local_name: "grandpy", url_https: "https://github.com/freezed/ocp7.git"}
- {local_name: "hellozappa", url_https: "https://gitlab.com/free_zed/hellozappa.git"}
- {local_name: "men-rt-ocp08", url_https: "https://github.com/remace/OC-P8-Purbeurre.git"}
- {local_name: "ldpy", url_https: "https://git.afpy.org/fcode/LDPy.git"}
- {local_name: "mountaingpx", url_https: "https://github.com/krisanselmo/mountaingpx.git"}
- {local_name: "myasb", url_https: "https://gitlab.com/forga/tool/ansible/debian.git"}
- {local_name: "mypsb", url_https: "https://gitlab.com/free_zed/mypsb.git"}
......
---
base_pkg:
- detox
- git
- htop
- iftop
- keychain
- locales
- lynx
- progress
- python3-apt
- python3-venv
- rsync
- screen
- sudo
- tree
- tmux
- unattended-upgrades
- unrar-free
- unzip
- vim
- wget
- xkcdpass
- xz-utils
- zsh
base_uninstall_pkg:
......@@ -37,6 +30,10 @@ base_uninstall_pkg:
workstat_pkg:
- ansible
- cheese
- easytag
- evolution
- evolution-plugins
- geany-plugin-addons
- geany-plugin-extrasel
- geany-plugin-git-changebar
......@@ -49,14 +46,15 @@ workstat_pkg:
- meld
- mhwaveedit
- pandoc
- python3-venv
station_pkg:
- cheese
- evolution
- evolution-plugins
- flatpak
- gimp
- git
- gimp
- gnome-disk-utility
- gnome-software-plugin-flatpak
- gpsprune
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment