Сергей Антоненко 2 anni fa
parent
commit
54ba2bca07
4 ha cambiato i file con 68 aggiunte e 0 eliminazioni
  1. 29 0
      change-wallpapers.yml
  2. BIN
      files/wallpaper.jpg
  3. 1 0
      hosts
  4. 38 0
      install-software-repo.yml

+ 29 - 0
change-wallpapers.yml

@@ -0,0 +1,29 @@
+---
+    - hosts: kc41
+      vars:
+        release: focal
+        winetricks_patch: /usr/bin
+        prefix_dir: /usr/prefixes
+        prefix_path: /usr/prefixes/msapps
+        user_permission: student
+        officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz
+      become: true
+      gather_facts: no
+      tasks:
+
+        - name: Copy wallpaper
+          ansible.builtin.copy:
+            src: /home/vidikon/ANSIBLE/software-playbooks/files/wallpaper.jpg
+            dest: /home/
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+        #1000 для pc9, 1001 для остальных
+        - name: Set wallpaper
+          vars:
+            DISPLAY: ":0"
+          ansible.builtin.shell: "sudo -H -u student DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id {{ user_permission }} | awk -F '=' '{print $2}' | awk -F '(' '{print $1}')/bus DISPLAY=:0 gsettings set org.cinnamon.desktop.background picture-uri 'file:///home/wallpaper.jpg'"
+        - name: Ensure a job that runs at 2 and 5 exists. Creates an entry like "0 5,2 * * ls -alh > /dev/null"
+          ansible.builtin.cron:
+            name: "check wallpaper"
+            minute: "*/5"
+            job: "sudo -H -u student DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id {{ user_permission }} | awk -F '=' '{print $2}' | awk -F '(' '{print $1}')/bus DISPLAY=:0 gsettings set org.cinnamon.desktop.background picture-uri 'file:///home/wallpaper.jpg'"  

BIN
files/wallpaper.jpg


+ 1 - 0
hosts

@@ -10,3 +10,4 @@ pc5 ansible_host=192.168.1.199
 pc6 ansible_host=192.168.1.122
 pc7 ansible_host=192.168.1.196
 pc8 ansible_host=192.168.1.159
+pc9 ansible_host=192.168.1.170

+ 38 - 0
install-software-repo.yml

@@ -0,0 +1,38 @@
+---
+    - hosts: pc9
+      vars:
+        release: focal
+        winetricks_patch: /usr/bin
+        prefix_dir: /usr/prefixes
+        prefix_path: /usr/prefixes/msapps
+        user_permission: student
+        officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz
+      become: true
+      gather_facts: no
+      tasks:
+
+#        - name: add ppa libreoffice
+#          ansible.builtin.apt_repository:
+#            repo: ppa:libreoffice/ppa
+#            codename: "{{ release }}"
+#            state: absent
+        - name: add ppa gimp
+          ansible.builtin.apt_repository:
+            repo: ppa:ubuntuhandbook1/gimp
+            codename: "{{ release }}"
+#            state: absent
+   #     - name: dpkg --configure -a
+   #       shell: 
+   #         cmd: dpkg --configure -a
+        - name: install software
+          ansible.builtin.apt: 
+            pkg: 
+              - libreoffice
+              - gimp
+        - name: install software
+          ansible.builtin.apt: 
+            pkg: 
+              - libreoffice-grammarcheck-ru
+              - libreoffice-help-ru 
+              - libreoffice-l10n-ru
+              - libreoffice-lightproof-ru-ru