mise à jour client Ubuntu
authoralexandre.domont@auf.org <alexandre.domont@auf.org>
Thu, 10 Jul 2014 15:30:19 +0000 (17:30 +0200)
committeralexandre.domont@auf.org <alexandre.domont@auf.org>
Thu, 10 Jul 2014 15:30:19 +0000 (17:30 +0200)
14 files changed:
paris/clients/hosts [new file with mode: 0644]
paris/clients/miseajour.yml [new file with mode: 0644]
paris/clients/roles/mise-a-jour/files/owncloud-client.list [new file with mode: 0644]
paris/clients/roles/mise-a-jour/handlers/main.yml [new file with mode: 0644]
paris/clients/roles/mise-a-jour/tasks/main.yml [new file with mode: 0644]
paris/clients/roles/wake-on-lan/files/owncloud-client.list [new file with mode: 0644]
paris/clients/roles/wake-on-lan/handlers/main.yml [new file with mode: 0644]
paris/clients/roles/wake-on-lan/tasks/main.yml [new file with mode: 0644]
paris/clients/roles/wake-on-lan/vars/main.yml [new file with mode: 0644]
paris/clients/wakeonlan-jeudi.yml [new file with mode: 0644]
paris/clients/wakeonlan-vendredi.yml [new file with mode: 0644]
paris/serveurs/hosts
paris/serveurs/ssh-server.yml
paris/serveurs/upgrade.yml

diff --git a/paris/clients/hosts b/paris/clients/hosts
new file mode 100644 (file)
index 0000000..519866a
--- /dev/null
@@ -0,0 +1,7 @@
+localhost
+
+[WAKEONLAN]
+192.168.0.104
+10.72.11.223
+10.72.11.240
+10.72.11.219
diff --git a/paris/clients/miseajour.yml b/paris/clients/miseajour.yml
new file mode 100644 (file)
index 0000000..4df9c99
--- /dev/null
@@ -0,0 +1,10 @@
+- hosts: WAKEONLAN 
+  user: root 
+
+  vars:
+   vuser: 2
+   vtime: 900
+
+  roles:
+    - mise-a-jour
+    
diff --git a/paris/clients/roles/mise-a-jour/files/owncloud-client.list b/paris/clients/roles/mise-a-jour/files/owncloud-client.list
new file mode 100644 (file)
index 0000000..2d3a7f9
--- /dev/null
@@ -0,0 +1 @@
+deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/xUbuntu_12.04/ /
diff --git a/paris/clients/roles/mise-a-jour/handlers/main.yml b/paris/clients/roles/mise-a-jour/handlers/main.yml
new file mode 100644 (file)
index 0000000..adf69e1
--- /dev/null
@@ -0,0 +1,2 @@
+- name: shutdown client
+  command: "echo titi > /tmp/titi"
diff --git a/paris/clients/roles/mise-a-jour/tasks/main.yml b/paris/clients/roles/mise-a-jour/tasks/main.yml
new file mode 100644 (file)
index 0000000..ee4b297
--- /dev/null
@@ -0,0 +1,19 @@
+- name: nombre users connectes
+  shell: "who | wc -l"
+  register: vuser
+  
+
+- name: temps allumage machine
+  shell: "cat /proc/uptime | awk '{print $1}'"
+  register: vtime
+  
+- name: mise a jour update upgrade
+  apt: upgrade=yes update_cache=yes
+  when: vtime.stdout|int < 1800 and vuser.stdout|int == 1
+  
+- name: extinction ordinateur
+  shell: "poweroff"
+  when: vuser.stdout|int == 1
+
+#- name: warning user
+
diff --git a/paris/clients/roles/wake-on-lan/files/owncloud-client.list b/paris/clients/roles/wake-on-lan/files/owncloud-client.list
new file mode 100644 (file)
index 0000000..2d3a7f9
--- /dev/null
@@ -0,0 +1 @@
+deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/xUbuntu_12.04/ /
diff --git a/paris/clients/roles/wake-on-lan/handlers/main.yml b/paris/clients/roles/wake-on-lan/handlers/main.yml
new file mode 100644 (file)
index 0000000..95b396f
--- /dev/null
@@ -0,0 +1,2 @@
+- name: add key owncloud
+  apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key state=present
diff --git a/paris/clients/roles/wake-on-lan/tasks/main.yml b/paris/clients/roles/wake-on-lan/tasks/main.yml
new file mode 100644 (file)
index 0000000..9f7e942
--- /dev/null
@@ -0,0 +1,3 @@
+- name: loop mac
+  shell: "wakeonlan {{ item }} "
+  with_flattened: jour
diff --git a/paris/clients/roles/wake-on-lan/vars/main.yml b/paris/clients/roles/wake-on-lan/vars/main.yml
new file mode 100644 (file)
index 0000000..9a1aec2
--- /dev/null
@@ -0,0 +1,14 @@
+lundi:
+  - [ '00:01:80:81:cf:37', '00:01:80:81:cf:0d' ]
+
+mardi:
+  - [ '00:01:80:81:cf:37', '00:01:80:81:cf:0d' ]
+
+mercredi:
+  - [ '00:01:80:81:cf:37', '00:01:80:81:cf:0d' ]
+
+jeudi:
+  - [ '00:01:80:81:cf:37', '00:01:80:81:c3:c6' ]
+
+vendredi:
+  - [ '00:01:80:81:cf:37', '00:14:0b:81:4d:32' ] 
diff --git a/paris/clients/wakeonlan-jeudi.yml b/paris/clients/wakeonlan-jeudi.yml
new file mode 100644 (file)
index 0000000..30ee0d6
--- /dev/null
@@ -0,0 +1,6 @@
+- hosts: localhost
+  user: root 
+  vars: 
+    jour: "jeudi"
+  roles:
+    - wake-on-lan
diff --git a/paris/clients/wakeonlan-vendredi.yml b/paris/clients/wakeonlan-vendredi.yml
new file mode 100644 (file)
index 0000000..8557303
--- /dev/null
@@ -0,0 +1,6 @@
+- hosts: localhost
+  user: root 
+  vars: 
+    jour: "vendredi"
+  roles:
+    - wake-on-lan
index d0bb76e..9f5acfe 100644 (file)
@@ -1,4 +1,5 @@
 #localhost
+10.72.11.236
 
 [LOCAL]
 localhost
@@ -18,4 +19,7 @@ bck-ovh.refer.org
 bck-online.refer.org
 
 [PRE]
-37.59.165.30
+#37.59.165.30
+vzauf16.refer.org
+vzauf15.refer.org
+vzauf14.refer.org
index 277ff3a..7142099 100644 (file)
@@ -1,6 +1,6 @@
 # file: ssh-server.yml
 # ansible-playbook -i hosts ssh-server.yml -K
-- hosts: LOCAL
+- hosts: 10.72.11.236
   user: alex
   sudo: yes
  
index 0d3ef53..679eeff 100644 (file)
@@ -1,6 +1,6 @@
 # file: ssh-server.yml
 # ansible-playbook -i hosts ssh-server.yml -K
-- hosts: LOCAL
+- hosts: PRE
   user: alex
   sudo: yes