diff --git a/gnupg.yml b/gnupg.yml new file mode 100644 index 0000000..cd2ae7a --- /dev/null +++ b/gnupg.yml @@ -0,0 +1,8 @@ +--- + +- name: Sets up gpg and the configs for using it as a ssh-agent + #connection: local + hosts: gnupg + become: true + roles: + - gnupg diff --git a/inventory.yaml b/inventory.yaml new file mode 100644 index 0000000..5b46f5c --- /dev/null +++ b/inventory.yaml @@ -0,0 +1,20 @@ +--- + +all: + hosts: + xenon: + ansible_host: xenon.int.finallycoffee.eu + ansible_connection: local + vars: + ansible_user: transcaffeine + ansible_become_user: transcaffeine + ansible_become: true + +gnupg: + hosts: + xenon: + +redshift: + hosts: + xenon: + diff --git a/gnupg/gnupg_agent b/legacy/gnupg/gnupg_agent similarity index 100% rename from gnupg/gnupg_agent rename to legacy/gnupg/gnupg_agent diff --git a/gnupg/gpg-agent.conf b/legacy/gnupg/gpg-agent.conf similarity index 100% rename from gnupg/gpg-agent.conf rename to legacy/gnupg/gpg-agent.conf diff --git a/gnupg/gpg.conf b/legacy/gnupg/gpg.conf similarity index 100% rename from gnupg/gpg.conf rename to legacy/gnupg/gpg.conf diff --git a/gnupg/sshcontrol b/legacy/gnupg/sshcontrol similarity index 100% rename from gnupg/sshcontrol rename to legacy/gnupg/sshcontrol diff --git a/initialSetup.sh b/legacy/initialSetup.sh similarity index 100% rename from initialSetup.sh rename to legacy/initialSetup.sh diff --git a/keybindings.sh b/legacy/keybindings.sh similarity index 100% rename from keybindings.sh rename to legacy/keybindings.sh diff --git a/xfce4-keyboard-shortcuts.xml b/legacy/xfce4-keyboard-shortcuts.xml similarity index 100% rename from xfce4-keyboard-shortcuts.xml rename to legacy/xfce4-keyboard-shortcuts.xml diff --git a/redshift.yml b/redshift.yml new file mode 100644 index 0000000..21ef9f3 --- /dev/null +++ b/redshift.yml @@ -0,0 +1,7 @@ +--- + +- name: Sets up redshift and creates an autostart file + hosts: redshift + become: true + roles: + - redshift diff --git a/bash_aliases b/roles/bash/templates/bash_aliases similarity index 54% rename from bash_aliases rename to roles/bash/templates/bash_aliases index 88cc58a..df4fd51 100644 --- a/bash_aliases +++ b/roles/bash/templates/bash_aliases @@ -2,7 +2,14 @@ alias ll='ls -al --color=auto' alias ls='ls -l --color=auto' +alias nb=man +alias enby=man + +alias furryfox=firefox + +alias flauschctl=systemctl # GnuPG2 alias gpg=gpg2 + diff --git a/costumPrompt.sh b/roles/bash/templates/bash_includes/costumPrompt.sh similarity index 100% rename from costumPrompt.sh rename to roles/bash/templates/bash_includes/costumPrompt.sh diff --git a/bash_includes/mushy.sh b/roles/bash/templates/bash_includes/moshy.sh similarity index 100% rename from bash_includes/mushy.sh rename to roles/bash/templates/bash_includes/moshy.sh diff --git a/roles/gnupg/defaults/main.yml b/roles/gnupg/defaults/main.yml index 4687fc3..2ca58dc 100644 --- a/roles/gnupg/defaults/main.yml +++ b/roles/gnupg/defaults/main.yml @@ -5,3 +5,5 @@ gpg_cache_ttl_ssh: 300 # Array of all keygrips to pass to sshcontrol gpg_keygrips: [] +gpg_folder: "~/.gnupg" + diff --git a/roles/gnupg/files/gnupg_agent b/roles/gnupg/files/gnupg_agent deleted file mode 100755 index 1de5761..0000000 --- a/roles/gnupg/files/gnupg_agent +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -rc=$(pgrep gpg-agent) -if [ "$rc" != 0 ]; then - export GPG_AGENT_INFO - export SSH_AUTH_SOCK - export SSH_AGENT_PID -else - eval $(gpg-agent --daemon) -fi - -gpg-connect-agent /bye -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index 1ba4f4e..79ae2b6 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -2,27 +2,40 @@ # Installs GnuPG2 and templates the configs - name: Install gnupg (RedHat*) - yum: name=gnupg2 state=latest + package: + name: gnupg2 + state: latest when: ansible_os_family == "RedHat" - name: Install gnupg (Arch) - pacman: + package: name: gnupg state: latest when: ansible_os_family == "Archlinux" - name: Configure gpg.conf (behaviour of gpg) - template: src=gpg.conf.j2 ~/.gnupg/gpg.conf + template: + src: gpg.conf.j2 + dest: "{{ gpg_folder }}/gpg.conf" - name: Configure gpg-agent.conf (agent configuration) - template: src=gpg-agent.conf.j2 ~/.gnupg/gpg-agent.conf + template: + src: gpg-agent.conf.j2 + dest: "{{ gpg_folder }}/gpg-agent.conf" - name: Configure ssh-control (in order for gpg-agent to act as ssh-agent) - template: src=sshcontrol.j2 ~/.gnupg/sshcontrol + template: + src: sshcontrol.j2 + dest: "{{ gpg_folder }}/sshcontrol" - name: Copy gnupg_agent script, which makes gpg-agent responsible for ssh-auth - copy: - src: "{{ role_path }}/files/gpg_agent" - dest: ~/.gnupg/gpg_agent + template: + src: gnupg_agent.j2 + dest: "{{ gpg_folder }}/gnupg_agent" mode: 0700 + + + + + diff --git a/roles/gnupg/templates/gnupg_agent.j2 b/roles/gnupg/templates/gnupg_agent.j2 index e69de29..1de5761 100644 --- a/roles/gnupg/templates/gnupg_agent.j2 +++ b/roles/gnupg/templates/gnupg_agent.j2 @@ -0,0 +1,14 @@ +#!/bin/bash + +rc=$(pgrep gpg-agent) +if [ "$rc" != 0 ]; then + export GPG_AGENT_INFO + export SSH_AUTH_SOCK + export SSH_AGENT_PID +else + eval $(gpg-agent --daemon) +fi + +gpg-connect-agent /bye +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + diff --git a/roles/gnupg/templates/sshcontrol.j2 b/roles/gnupg/templates/sshcontrol.j2 index 3c6a2c2..afca206 100644 --- a/roles/gnupg/templates/sshcontrol.j2 +++ b/roles/gnupg/templates/sshcontrol.j2 @@ -10,5 +10,5 @@ # flags. Prepend the keygrip with an '!' mark to disable it. {% for keygrip in gpg_keygrips %} -{{ gpg_keygrips.keygrip }} +{{ keygrip }} {% endfor %} diff --git a/roles/redshift/tasks/main.yml b/roles/redshift/tasks/main.yml new file mode 100644 index 0000000..04d6944 --- /dev/null +++ b/roles/redshift/tasks/main.yml @@ -0,0 +1,23 @@ +--- + +- name: Install redshift + package: + name: redshift + state: present + + +- name: Ensure .config folder for redshift exists + file: + path: ~/.config/redshift + state: directory + +- name: Template redshift config + template: + src: redshift.conf.j2 + dest: ~/.config/redshift/redshift.conf + +- name: Template redshift autostart file + template: + src: redshift-gtk.desktop.j2 + dest: ~/.config/autostart/redshift-gtk.desktop + diff --git a/roles/redshift/templates/redshift-gtk.desktop.j2 b/roles/redshift/templates/redshift-gtk.desktop.j2 new file mode 100644 index 0000000..8d81728 --- /dev/null +++ b/roles/redshift/templates/redshift-gtk.desktop.j2 @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Name=Redshift +Exec=redshift-gtk +Icon=redshift +Terminal=false +Type=Application +Categories=Utility; +StartupNotify=true +Hidden=false +X-GNOME-Autostart-enabled=true + diff --git a/redshift/redshift.conf b/roles/redshift/templates/redshift.conf.j2 similarity index 100% rename from redshift/redshift.conf rename to roles/redshift/templates/redshift.conf.j2 diff --git a/tmux/tmux.conf b/roles/tmux/templates/tmux.conf similarity index 100% rename from tmux/tmux.conf rename to roles/tmux/templates/tmux.conf diff --git a/vim/colors/kuroi.vim b/roles/vim/templates/colors/kuroi.vim similarity index 100% rename from vim/colors/kuroi.vim rename to roles/vim/templates/colors/kuroi.vim diff --git a/vim/vimrc b/roles/vim/templates/vimrc similarity index 100% rename from vim/vimrc rename to roles/vim/templates/vimrc