1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-08-16 13:09:48 +02:00

Add repo checkout

This commit is contained in:
L3D 2020-03-12 23:03:29 +01:00
parent d8b52131c0
commit 15abdf974c
Signed by: l3d
GPG key ID: CD08445BFF4313D1
5 changed files with 13 additions and 13 deletions

View file

@ -65,10 +65,9 @@ weechat:
```yaml ```yaml
weechat: weechat:
home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}/.weechat" home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}"
``` ```
+ the path where the weechat home is located. If the variable ``{{ ansible_env.HOME }}`` is not set it will use ``"/home/{{ weechat.user }}"`` as fallback. + the path where the weechat home is located. If the variable ``{{ ansible_env.HOME }}`` is not set it will use ``"/home/{{ weechat.user }}"`` as fallback.
+ it points in the ``.weechat`` directory of your home.
```yaml ```yaml
weechat: weechat:
@ -82,7 +81,7 @@ weechat:
private_repo: false private_repo: false
``` ```
+ The path to your git repo with your personal weechat config. + The path to your git repo with your personal weechat config.
+ This role clones the repo to the ``{{ weechat.home_directory }}`` destination. *(Also known al your local .weechat directory.)* It will fail if you already have files and/or folders in your local .weechat dorectory. + This role clones the repo to the ``"{{ weechat.home_directory }}/.weechat"`` directory. *(Also known al your local .weechat directory.)* It will fail if you already have files and/or folders in your local .weechat dorectory.
+ You have to add, commit and push the local changes in your local .weechat folder manually. Please be aware that it is a good idea to disable your log or at least add the weechatlog folder to your .gitignore file in your personal weechat config. + You have to add, commit and push the local changes in your local .weechat folder manually. Please be aware that it is a good idea to disable your log or at least add the weechatlog folder to your .gitignore file in your personal weechat config.
```yaml ```yaml
@ -90,7 +89,7 @@ weechat:
custom_config: custom_config:
gen_ssh_key_pair: true gen_ssh_key_pair: true
``` ```
+ ``weechat.custom_config.gen_ssh_key_pair: true``: We will generate a eleptic curve ssh key *(if it not already exist at ``"{{ weechat.home_directory }}/../.ssh/id_ed25519"``)* and print the public key to the prompt. This will give you the time to add this public key to your private git repo for your own weechat config as deploy key. This is required to download your private repo withour username/password. This requires that you set ``{{ weechat.custom_config.private_repo }}`` to the ssh accessable version of your git repo. + ``weechat.custom_config.gen_ssh_key_pair: true``: We will generate a eleptic curve ssh key *(if it not already exist at ``"{{ weechat.home_directory }}/.ssh/id_ed25519"``)* and print the public key to the prompt. This will give you the time to add this public key to your private git repo for your own weechat config as deploy key. This is required to download your private repo withour username/password. This requires that you set ``{{ weechat.custom_config.private_repo }}`` to the ssh accessable version of your git repo.
+ ``weechat.custom_config.gen_ssh_key_pair: false``: We do not manage access to the git repo with your weechat config. + ``weechat.custom_config.gen_ssh_key_pair: false``: We do not manage access to the git repo with your weechat config.
```txt ```txt

View file

@ -11,7 +11,7 @@ weechat:
# user to install and use weechat # user to install and use weechat
user: "{{ ansible_user_id }}" user: "{{ ansible_user_id }}"
# where is our home direcotory for weechat # where is our home direcotory for weechat
home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}/.weechat" home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}"
# plugins we want # plugins we want
plugins: [] plugins: []
# weechat gpg key for debian/ubuntu repo # weechat gpg key for debian/ubuntu repo

View file

@ -3,7 +3,7 @@
become_user: "{{ weechat.user }}" become_user: "{{ weechat.user }}"
become: true become: true
openssh_keypair: openssh_keypair:
path: "{{ weechat.home_directory }}/../.ssh/id_ed25519" path: "{{ weechat.home_directory }}/.ssh/id_ed25519"
type: ed25519 type: ed25519
owner: "{{ weechat.user }}" owner: "{{ weechat.user }}"
register: ssh_key_pair register: ssh_key_pair
@ -38,6 +38,7 @@
become: true become: true
git: git:
repo: "{{ weechat.custom_config.private_repo }}" repo: "{{ weechat.custom_config.private_repo }}"
dest: "{{ weechat.home_directory }}" dest: "{{ weechat.home_directory }}/.weechat"
version: master version: master
accept_hostkey: yes
when: not weechat.custom_config.private_repo | bool when: not weechat.custom_config.private_repo | bool

View file

@ -3,7 +3,7 @@
become: true become: true
become_user: "{{ weechat.user }}" become_user: "{{ weechat.user }}"
file: file:
path: "{{ weechat.home_directory }}" path: "{{ weechat.home_directory }}/.weechat"
state: directory state: directory
owner: "{{ weechat.user }}" owner: "{{ weechat.user }}"
mode: "0750" mode: "0750"
@ -12,7 +12,7 @@
become: true become: true
become_user: "{{ weechat.user }}" become_user: "{{ weechat.user }}"
file: file:
path: "{{ weechat.home_directory }}/{{ item.value }}/autoload" path: "{{ weechat.home_directory }}/.weechat/{{ item.value }}/autoload"
state: directory state: directory
owner: "{{ weechat.user }}" owner: "{{ weechat.user }}"
mode: "0750" mode: "0750"
@ -21,12 +21,12 @@
- name: download weechat plugins - name: download weechat plugins
get_url: get_url:
url: 'https://weechat.org/files/scripts/{{ item }}' url: 'https://weechat.org/files/scripts/{{ item }}'
dest: "{{ weechat.home_directory }}/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" dest: "{{ weechat.home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}"
with_items: '{{ weechat.plugins }}' with_items: '{{ weechat.plugins }}'
- name: symlinking plugins to autoload - name: symlinking plugins to autoload
file: file:
src: "{{ weechat.home_directory }}/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" src: "{{ weechat.home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}"
dest: "{{ weechat.home_directory }}/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/autoload/{{ item }}" dest: "{{ weechat.home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/autoload/{{ item }}"
state: link state: link
with_items: '{{ weechat.plugins }}' with_items: '{{ weechat.plugins }}'

View file

@ -18,7 +18,7 @@ _weechat:
autostart: false autostart: false
install_plugins: false install_plugins: false
user: "{{ ansible_user_id }}" user: "{{ ansible_user_id }}"
home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}/.weechat" home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}"
plugins: [] plugins: []
gpg_id: '11E9DE8848F2B65222AA75B8D1820DB22A11534E' gpg_id: '11E9DE8848F2B65222AA75B8D1820DB22A11534E'
use_custom_config: false use_custom_config: false