summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2017-08-09 21:07:42 +0200
committerMatthieu Saulnier <fantom@fedoraproject.org>2017-08-09 21:07:42 +0200
commit47e5c585738750db676b3e615990204f4ce93866 (patch)
tree972f9bf47e8ba267742efb830e73ddb9c76298e2
parent069a151847113736886c11dc27d947c2c77de0ab (diff)
downloadplaybooks-ansible-47e5c585738750db676b3e615990204f4ce93866.tar.gz
playbooks-ansible-47e5c585738750db676b3e615990204f4ce93866.tar.xz
playbooks-ansible-47e5c585738750db676b3e615990204f4ce93866.zip
disable broken selinux tasks and add toolbox scripts
-rwxr-xr-xroles/common/files/setfunctions.sh64
-rwxr-xr-xroles/common/files/startt.sh24
-rw-r--r--roles/common/tasks/binutils.yml17
-rw-r--r--roles/common/tasks/main.yml8
-rw-r--r--roles/common/tasks/selinux.yml4
5 files changed, 113 insertions, 4 deletions
diff --git a/roles/common/files/setfunctions.sh b/roles/common/files/setfunctions.sh
new file mode 100755
index 0000000..f60bbe8
--- /dev/null
+++ b/roles/common/files/setfunctions.sh
@@ -0,0 +1,64 @@
+function rebours {
+ i=$1
+ while [[ $i -ge 0 ]]
+ do
+ echo -e "\r"$i "\c"
+ sleep 1
+ i=$(expr $i - 1)
+ done
+ echo ""
+}
+
+function xtail {
+ if [ "$#" -gt 0 ]
+ then
+ gnome-terminal -e "tail -n 0 -f $@"
+ else
+ echo "Input interdit"
+ fi
+}
+
+function xless {
+ if [ "$#" -gt 0 ]
+ then
+ gnome-terminal -e "less $@"
+ else
+ echo "Input interdit"
+ fi
+}
+
+function xcat {
+ command=$@
+ gnome-terminal -e "$command"
+}
+
+function phone2 {
+ ssh-agent > /tmp/vars.txt
+ . /tmp/vars.txt
+ ssh-add ~/.ssh/xcg
+}
+
+function phone3 {
+ ssh-agent > /tmp/vars.txt
+ . /tmp/vars.txt
+ ssh-add ~/.ssh/id_rsa
+}
+
+function blocnote {
+ trsync -aPh casper@falcon:Images/bloc-notes/courant/\* ~/Images/Bloc-notes/
+}
+
+function onionlookup {
+ SUFFIX=.casperlefantom.net
+ while test $# -gt 0
+ do
+ RESULT=`dig TXT +short $1$SUFFIX`
+ if [[ $RESULT != "www.casperlefantom.net." ]]
+ then
+ echo $RESULT | sed 's/"//g'
+ else
+ echo "erreur: domaine $1 hors-zone DNS"
+ fi
+ shift
+ done
+}
diff --git a/roles/common/files/startt.sh b/roles/common/files/startt.sh
new file mode 100755
index 0000000..61f4d59
--- /dev/null
+++ b/roles/common/files/startt.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# bureau 1 et démarre session start
+tmux new-session -d -s start -n desktop1
+tmux split-window -v
+tmux selectp -t 1
+tmux split-window -h
+tmux selectp -t 3
+tmux split-window -h
+# ajoute 5 nouveaux bureaux
+for i in 2 3 4 5 6
+do
+ tmux new-window -n desktop$i
+ tmux split-window -v
+ tmux selectp -t 1
+ tmux split-window -h
+ tmux selectp -t 3
+ tmux split-window -h
+ tmux selectp -t 3
+done
+# fin, réacquisition de la session start
+tmux selectw -t 1
+tmux selectp -t 3
+tmux -2 attach-session -d
diff --git a/roles/common/tasks/binutils.yml b/roles/common/tasks/binutils.yml
new file mode 100644
index 0000000..74371da
--- /dev/null
+++ b/roles/common/tasks/binutils.yml
@@ -0,0 +1,17 @@
+- name: Création des répertoires
+ file: name={{ item }} state=directory
+ with_items:
+ - /root/bin/
+ - /etc/skel/bin/
+
+- name: Installation des scripts pour root
+ copy: src={{ item.name }} dest=/root/bin/{{ item.dest }} mode=755
+ with_items:
+ - { name: 'setfunctions.sh', dest: 'setfunctions' }
+ - { name: 'startt.sh', dest: 'startt' }
+
+- name: Installation des scripts pour squelette
+ copy: src={{ item.name }} dest=/etc/skel/bin/{{ item.dest }} mode=755
+ with_items:
+ - { name: 'setfunctions.sh', dest: 'setfunctions' }
+ - { name: 'startt.sh', dest: 'startt' }
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 217897a..b0d99f8 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -10,6 +10,9 @@
- name: Installation des fichiers RC
include: rc.yml
+- name: Installation des scripts de base
+ include: binutils.yml
+
- name: Installation des points de montage standard
include: mnt.yml
@@ -55,5 +58,6 @@
- name: Changement de shell pour root
include: zsh.yml
-- name: Activation de SELinux
- include: selinux.yml
+# ne fonctionne pas
+#- name: Activation de SELinux
+# include: selinux.yml
diff --git a/roles/common/tasks/selinux.yml b/roles/common/tasks/selinux.yml
index ccd7140..0f55f88 100644
--- a/roles/common/tasks/selinux.yml
+++ b/roles/common/tasks/selinux.yml
@@ -1,7 +1,7 @@
- name: Rapport SELinux
copy: src=eaureport.sh dest=/etc/cron.daily/eaureport.sh mode=755
- when: ansible_selinux.status != "disabled"
+ when: ansible_selinux.status == "enabled"
- name: Relabel système de fichier
copy: src=selinuxresto.sh dest=/etc/cron.monthly/selinuxresto.sh mode=755
- when: ansible_selinux.status != "disabled"
+ when: ansible_selinux.status == "enabled"