1
0

3 Коммиты 9c2d815579 ... f6d0c1a96f

Автор SHA1 Сообщение Дата
  Сергей Антоненко f6d0c1a96f reinit repo 2 лет назад
  Сергей Антоненко dc72b378fc reinit repo 2 лет назад
  Сергей Антоненко 54ba2bca07 add new task 2 лет назад

+ 2 - 1
.gitignore

@@ -1,2 +1,3 @@
 test
-group_vars
+group_vars
+local

+ 7 - 0
LICENSE

@@ -1,2 +1,9 @@
 # software-playbooks
 
+В репозитории список плейбуков, в дальнейшем будет сформирован в роли
+
+### sudoedit.yml
+
+Позволяет управлять правами пользователя на запуск приложений в привилегированом режиме
+
+[Ссылка на документацию](https://docs.ansible.com/ansible/latest/collections/community/general/sudoers_module.html)

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

BIN
ico/stream-icon.png


+ 17 - 0
inventory/hosts

@@ -0,0 +1,17 @@
+[test_group]
+userps ansible_host=192.168.122.73
+
+[local]
+notebook ansible_host=127.0.0.1
+
+
+[kc41]
+pc1 ansible_host=192.168.1.124
+pc2 ansible_host=192.168.1.62
+pc3 ansible_host=192.168.1.21
+pc4 ansible_host=192.168.1.143
+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
playbooks/add_stream_shortcut.yml

@@ -0,0 +1,38 @@
+---
+    - hosts: local
+      vars:
+        release: focal
+        user_permission: vidikon
+        stream_multicast_link: 'udp://@224.0.0.230:8001'
+        icon_patch: /home/{{ user_permission }}/icons
+        shortcut_ico_path: "{{ icon_patch }}/stream-icon.png"
+      become: true
+      gather_facts: no
+      tasks:
+        
+        - name: Install VLC
+          ansible.builtin.apt:
+            pkg:
+              - vlc
+
+        - name: Create icon dir
+          ansible.builtin.file:
+            path: "{{ icon_patch }}"
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+            state: directory
+
+        - name: Copy icon
+          ansible.builtin.copy:
+            src: /home/vidikon/ANSIBLE/software-playbooks/ico/stream-icon.png
+            dest: "{{ icon_patch }}"
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+
+        - name: Copy shortcut template
+          ansible.builtin.template: 
+            src: /home/vidikon/ANSIBLE/software-playbooks/program_shortcut/Connect.j2
+            dest: '/home/vidikon/Рабочий стол/Connect.desktop'
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+            mode: u=rwx,g=rwx,o=r

+ 29 - 0
playbooks/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'"  

+ 0 - 0
copy-office-2010.yml → playbooks/copy-office-2010.yml


+ 0 - 0
install-anydesk.yml → playbooks/install-anydesk.yml


+ 0 - 0
install-arduino-ide.yml → playbooks/install-arduino-ide.yml


+ 38 - 0
playbooks/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

+ 91 - 0
playbooks/install-wine.yml

@@ -0,0 +1,91 @@
+---
+- hosts: pc8
+  vars:
+    release: focal
+    winetricks_patch: /usr/bin
+    prefix_dir: /usr/prefixes
+    prefix_path: /usr/prefixes/msapps
+    user_permission: oktadmin
+    officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz
+  #become: true
+  gather_facts: no
+  tasks:
+#    - name: dpkg --configure -a
+#      become: true
+#      ansible.builtin.shell: dpkg --remove --force-remove-reinstreq packettracer
+#    - name: Upgrade all packets
+#      become: true
+#      ansible.builtin.apt:
+#        name: "*"
+#        state: latest
+
+
+    - name: wine (add architecture)
+      become: true
+      shell: 
+        cmd: dpkg --add-architecture i386
+
+    - name: install software-properties-common deb
+      become: true
+      ansible.builtin.apt: 
+        pkg: 
+        - software-properties-common
+        - dirmngr
+        - ca-certificates
+        - apt-transport-https
+        - curl
+        
+
+    - name: One way to avoid apt_key once it is removed from your distro
+      become: true
+      block:
+        - name: add key
+          ansible.builtin.shell: curl -s https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/winehq.gpg > /dev/null
+
+        #- name: somerepo |no apt key
+        #  ansible.builtin.get_url:
+        #    url: https://dl.winehq.org/wine-builds/winehq.key
+        #    dest: /usr/share/keyrings/winehq.gpg
+
+        - name: add repo
+          ansible.builtin.apt_repository:
+            repo: "deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ {{ release }} main"
+            state: present
+
+        - name: install Wine deb
+          ansible.builtin.apt: 
+            pkg: 
+            - winehq-stable
+            - winetricks
+            update_cache: yes
+
+    - name: Create prefix dir
+      become: true
+      block:
+        - name: Copy winetrics file with owner and permission
+          ansible.builtin.copy:
+            src: "/home/vidikon/ANSIBLE/software-playbooks/scripts/winetricks"
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+            dest: /usr/bin/winetricks
+            mode: u=rwx,g=rwx,o=wr
+        - name: Create a directory if it does not exist
+          ansible.builtin.file:
+            path: "{{ prefix_dir }}"
+            owner: "{{ user_permission }}"
+            group: "{{ user_permission }}"
+            state: directory
+    - name: Create prefix
+      block: 
+   #     - name: Create Office prefix
+   #       ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} wineboot -u
+   #     - name: Download font
+   #       ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks corefonts allfonts 
+        - name: Download lib
+          ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks  --torify msxml3 msxml4 msxml6 vcrun2015 dotnet40 gdiplus riched30 mfc42 mfc140 vcrun6
+          register: libinstall
+        - debug: msg="{{ libinstall }}"
+
+    
+
+

+ 0 - 0
install_onlyoffice.yml → playbooks/install_onlyoffice.yml


+ 22 - 0
playbooks/sudoedit.yml

@@ -0,0 +1,22 @@
+---
+    - hosts: local
+      vars:
+        release: focal
+        user_permission: vidikon
+        stream_multicast_link: 'udp://@224.0.0.230:8001'
+        icon_patch: /home/{{ user_permission }}/icons
+        shortcut_ico_path: "{{ icon_patch }}/stream-icon.png"
+      become: true
+      gather_facts: no
+      tasks:
+      
+        - name: Allow tcpdump
+          community.general.sudoers:
+            name: allow-tcpdump
+            state: present
+            user: vidikon
+            commands: /usr/bin/tcpdump
+            nopassword: true 
+            validation: absent
+
+

+ 9 - 0
program_shortcut/Connect.desktop

@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Name=Подключиться к трансляции
+Comment=описание
+Exec=vlc -f {{ stream_multicast_link }}
+Icon={{ shortcut_ico_path }}stream-icon.png
+Terminal=false
+Type=Application
+Categories=Video

+ 9 - 0
program_shortcut/Connect.j2

@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Name=Подключиться к трансляции
+Comment=описание
+Exec=vlc -f {{ stream_multicast_link }}
+Icon={{ shortcut_ico_path }}
+Terminal=false
+Type=Application
+Categories=Video

+ 0 - 0
files/arduino-ide.desktop → program_shortcut/arduino-ide.desktop


+ 0 - 0
files/onlyoffice-desktopeditors.desktop → program_shortcut/onlyoffice-desktopeditors.desktop


+ 0 - 0
scripts/winetricks