Outils pour utilisateurs

Outils du site


blog

Erreur OSError: [Errno 97] Address family not supported by protocol

OSError: [Errno 97] Address family not supported by protocol

Voir si le fichier /etc/hosts est correct. Utiliser une IPv4 à la place du nom.

Souvent un pb d'appel à IPv6 quand celui-ci est désactivé.

Ansible M(mail) : manque A(host) Exemple :

- name: mail
  mail:
    port: 22
    to: root@acme.local
    subject: alert
    body: >-
      Message...
2025/03/24 15:06

Ansible AWX - Tower Cli

Voir :

pip3 install awxkit
 
export AWXKIT_API_BASE_PATH=/api/controller/
 
awx --help

Connexion

export TOWER_HOST=https://aap.acme.local
export TOWER_USERNAME=jean
export TOWER_VERIFY_SSL=false
read -s TOWER_PASSWORD
#awx login --conf.host "$TOWER_HOST" --conf.username "$TOWER_USERNAME" --conf.password "$TOWER_PASSWORD" -k
awx login
awx ping | jq

Export

# awx --conf.host $TOWER_HOST --conf.token "TOKEN" export --projects "PLOP" > projects_PLOP.json
# awx --conf.host $TOWER_HOST --conf.token "TOKEN" export --inventory "PLOP" > inventory_PLOP.json
 
awx export --job_templates 42
awx export --job_template "plop" > tpl_plop.json
awx export --credentials "IOPS_GIT" > credentials_IOPS_GIT.json
 
 
# Exemple avec : http://localhost:3000/#/inventories/inventory/4/sources/15/details
awx export --inventory 4
# Il ne faut pas le numero de l'inventaire, mais celui de la source
awx export --inventory_source 15
 
awx -f yaml export > all.yaml

Vérif

for fic in tpl_*.json* ; do awx export --job_templates "$(cat $fic |jq -r '.job_templates[0].name')" > $fic.verif ; done

Import

export TOWER_HOST=https://aap.acme.local
awx login
awx import -v < tpl_388.json 2>err.log
awx import < credentials_IOPS_GIT.json
awx import < tpl_388.json

Autres commandes

awx jobs list --controller_node "old-aap.acme.local" -f human --filter id,name,started,completed --all
awx job_templates get 176
 
awx job list -f human
awx jobs list --all -f human --filter 'id,name,status'
awx job stdout 6

Alternatives à Ansible Tower / APP :

Voir aussi

tower-job.sh

#!/bin/bash
 
# tower-job
# https://gist.github.com/philcryer/fdce90d0b06517a49ff2fdba41b579df
 
# Variables
tower_template_id=574
 
# Directions
#
# install tower-cli
#   sudo pip install tower-cli
#
# put this file in a root of your project
#   {{ project_root }}/tower-job
#
# create a file ~/.tower-cli.cfg with contents:
#
#   [general]
#   host = fqdn.yourhost.com
#   username = your-username
#   password = ssssshhhhhhhh
#
# add variables from your tower survey to a vars file. we'll use group_vars/tower-job.yml
#   ---
#   survey_env: "DEV"
#   survey_version: "2.0"
#   survey_mychart_customer: "bob"
#
# define your job template ID # in variables above
#   job_template_id=574
#
# make this file executable
#   chmod 755 tower-job
#
# then run it
#   ./tower-job
 
set -e
 
if [ ! -d 'group_vars' ]; then
    echo "No group_vars found, run this out of root of project"; exit 1
fi
 
tower-cli job launch --job-template=$tower_template_id --extra-vars="@group_vars/tower-job.yml" | tee tower-job.pid
job_id=$(cat tower-job.pid | tail -n2 | head -n1 | awk '{print $1}')
rm tower-job.pid
while [ $(tower-cli job list --status=running | grep $job_id | wc -l) -lt '1' ]; do
    echo -n "-"; sleep 5;
done;
 
tower-cli job monitor $job_id
 
exit 0

https://www.insentra.com.au/protecting-the-automation-engine-backup-for-ansible-awx-project/

Voir aussi :

API Tower / AWS

Access Control - RBAC

Authentification Controle d'acces (Authorization) Imputabilité (Accoutability) Tracabilité (Traceability) Disponibilité (Availability) Confidentialité (Confidentiality)

Habilitation : Vidéo - Infuser du métier dans les autorisations avec ReBAC (Geoffroy BRAUN et Pauline JAMIN)

RBAC :

Voir :

Execute Role

https://www.unixarena.com/2019/03/ansible-tower-awx-configuring-role-based-access-rbac.html/

How Can I Map Organizations and Teams with LDAP in Ansible Tower?

Ansible Tower Teams Teams provide a means to implement role-based access control schemes and delegate responsibilities across organizations.


tower-cli workflow_job list -W 2389 --status running
2025/03/24 15:06

Ergonomie - fatigue des yeux - lumière bleu

Voir aussi :

Il existe des lunettes qui filtre la lumière bleu (par exemple le modèle “I-block” à 35 €)

Couleur écran

RedShift

Voir :

Voir aussi :

apt-get install redshift #gtk-redshift 
#cp -p /usr/share/doc/redshift/example-redshift.conf ~/.config/redshift.conf
# Couleur à 3300K
redshift -O 3300
 
# Reset
redshift -x

Lancement à l'ouverture de session

Configuration
# dpkg -L redshift |grep '\.service'
/usr/lib/systemd/user/redshift.service

/usr/lib/systemd/user/redshift.service

[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
After=display-manager.service
 
[Service]
ExecStart=/usr/bin/redshift
Restart=always
 
[Install]
WantedBy=default.target

~/.config/redshift.conf

[redshift]
temp-day=3000
temp-night=3000
systemctl --user enable --now redshift
Pb

Le service n'est plus démarré sans message d'erreur

systemctl start --user redshift
Solution

Ajouter la ligne suivante :

Environment="DISPLAY=:0"

/usr/lib/systemd/user/redshift.service

[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
After=display-manager.service
 
[Service]
Environment="DISPLAY=:0"
ExecStart=/usr/bin/redshift
Restart=always
 
[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl start --user redshift
Obsolète

~/.config/autostart/redshift.desktop

[Desktop Entry]
Type=Application
Name=redshift1
Exec=env DISPLAY=:0 redshift -O 3000

Autres

The neutral temperature is 6500K. Using this value will not
change the color temperature of the display. Setting the
color temperature to a value higher than this results in
more blue light, and setting a lower value will result in
more red light.

Default values:

  Daytime temperature: 5500K
  Night temperature: 3500K

Redshift et Wayland : https://kwygibo.wordpress.com/2016/12/12/redshift-in-gnomewayland-yes-we-can/ https://unix.stackexchange.com/questions/329805/redshift-in-gnome-on-wayland-on-debian

Raspberry https://turbolion.github.io/2017/01/25/redshift-on-lubuntu-on-a-raspberry-pi/

2025/03/24 15:06

Envoyer un message a un poste GNU/Linux

Voir :

  • write
  • wall (write to all)

Pour un poste bureautique avec le paquet libnotify-bin installé

export DISPLAY=:0 
notify-send -t 30000 "Titre" "Message"

Avant il peut être intéressant de sortir l'écran de sa mise en veille

export DISPLAY=:0 
xset dpms force on

Autres

alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
2025/03/24 15:06

EFI Notes partitions EFI GPT vs MBR

EFI/GPT

Source : http://www.ibm.com/support/knowledgecenter/SS42VS_7.2.6/com.ibm.qradar.doc/t_offboard_iscsi_configure_volume.html

Optional: To create a partition, use the GNU parted command :

parted /dev/volume
mklabel gpt
Warning: The existing disk label on /dev/volume will be
destroyed and all data on this disk will be lost. Do you want to
continue?
mkpart primary 0% 100%
unit TB
print
print free
quit
partprobe /dev/volume

Ou addpart / delpart ?

cat /proc/partitions

To create an XFS file system, type the following command :

mkfs.xfs -f /dev/partition

For an ext4 files system, type the following command :

mkfs.ext4 /dev/partition
#parted /dev/sdb mklabel gpt mkpart P1 0% 100%
parted /dev/sdb mklabel gpt mkpart primary ext4 0% 100%
parted /dev/sdb unit s print > sdb-pt.parted
parted -ms /dev/sdb print > sdb-pt.parted2
sdb.parted2
BYT;
/dev/sdb:322GB:scsi:512:512:gpt:EQLOGIC 100E-00:;
1:1049kB:322GB:322GB:ext4:primaire:;
Exemple
parted /dev/sdb mklabel msdos mkpart p xfs 0% 100%
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki