From d3357cb2d94d4379729a0b3fb3e78de1fa96a588 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 28 Oct 2021 07:28:24 -0500 Subject: [PATCH] Increase Telegraf Frequency + Flatpak Executables (#16) * Add a few aliases for initializing projects. * Begin creating executables in bin for flatpaks. Create an array to reduce future changes. * Add quotes. * Create files as user and set executable permissions. * Split exec dir from array section. * Increase interval for Telegraf but keep the flush at 30s. --- tasks/general/acct_mgmt/users.yml | 4 ++ tasks/general/software/telegraf.yml | 6 +-- tasks/workstation/linux/software/flatpaks.yml | 40 ++++++++++++++++--- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 3d885c1..1c9bfc9 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -145,6 +145,9 @@ } sync: alias sync='date && echo "Syncing!" && sync && date' editor: export EDITOR='vi' + init_aliases: | + alias init-video='mkdir -v raw; mkdir -v exports; cp ~/Templates/*video* ./' + alias init-prog='echo -e "#!/bin/bash\n# `date +%Y-%m-%d` by Hyperling\n# REASON\n\nexit 0\n"' - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -161,6 +164,7 @@ {{ update }} {{ sync }} {{ editor }} + {{ init_aliases }} - name: General | Account Management | Users | Files | .bashrc blockinfile: diff --git a/tasks/general/software/telegraf.yml b/tasks/general/software/telegraf.yml index 3a78519..b518e46 100644 --- a/tasks/general/software/telegraf.yml +++ b/tasks/general/software/telegraf.yml @@ -85,12 +85,12 @@ # user = "$USER" [agent] - interval = "30s" + interval = "5s" metric_batch_size = 1000 metric_buffer_limit = 10000 - collection_jitter = "3s" + collection_jitter = "0s" flush_interval = "30s" - flush_jitter = "7s" + flush_jitter = "10s" precision = "" # debug = false # quiet = false diff --git a/tasks/workstation/linux/software/flatpaks.yml b/tasks/workstation/linux/software/flatpaks.yml index eb78b57..1c0144a 100644 --- a/tasks/workstation/linux/software/flatpaks.yml +++ b/tasks/workstation/linux/software/flatpaks.yml @@ -17,19 +17,47 @@ ## Flatpak Installs ## +- name: Workstation | Linux | Flatpak Distro | Flatpak | Variables + set_fact: + flatpak_exec_dir: "{{ user_ling.home }}/bin" + # Generic # +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Array + set_fact: + flatpaks_generic: + - { app: "org.libreoffice.LibreOffice", name: "office" } + - { app: "com.discordapp.Discord", name: "discord" } + - { app: "org.telegram.desktop", name: "telegram" } + - { app: "io.lbry.lbry-app", name: "lbry" } + - name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Installs flatpak: - name: "{{ item }}" + name: "{{ item.app }}" remote: flathub state: present - loop: - - org.libreoffice.LibreOffice - - com.discordapp.Discord - - org.telegram.desktop - - io.lbry.lbry-app + loop: "{{ flatpaks_generic }}" ignore_errors: yes +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Executables + blockinfile: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + block: | + flatpak run {{ item.app }} + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + loop: "{{ flatpaks_generic }}" + become_user: ling + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic Executable Permissions + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: file + mode: '0755' + loop: "{{ flatpaks_generic }}" + # Coding # - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding Installs flatpak: