diff --git a/README.md b/README.md index 75f237f..a556df4 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,9 @@ weechat: ```yaml 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. -+ it points in the ``.weechat`` directory of your home. ```yaml weechat: @@ -82,7 +81,7 @@ weechat: private_repo: false ``` + 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. ```yaml @@ -90,7 +89,7 @@ weechat: custom_config: 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. ```txt diff --git a/defaults/main.yml b/defaults/main.yml index 0f68ba4..4d59c8d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,7 +11,7 @@ weechat: # user to install and use weechat user: "{{ ansible_user_id }}" # 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: [] # weechat gpg key for debian/ubuntu repo diff --git a/tasks/configure_custom_config.yml b/tasks/configure_custom_config.yml index d718278..8e3224e 100644 --- a/tasks/configure_custom_config.yml +++ b/tasks/configure_custom_config.yml @@ -3,7 +3,7 @@ become_user: "{{ weechat.user }}" become: true openssh_keypair: - path: "{{ weechat.home_directory }}/../.ssh/id_ed25519" + path: "{{ weechat.home_directory }}/.ssh/id_ed25519" type: ed25519 owner: "{{ weechat.user }}" register: ssh_key_pair @@ -38,6 +38,7 @@ become: true git: repo: "{{ weechat.custom_config.private_repo }}" - dest: "{{ weechat.home_directory }}" + dest: "{{ weechat.home_directory }}/.weechat" version: master + accept_hostkey: yes when: not weechat.custom_config.private_repo | bool diff --git a/tasks/configure_plugins.yml b/tasks/configure_plugins.yml index be0e488..b1d030d 100644 --- a/tasks/configure_plugins.yml +++ b/tasks/configure_plugins.yml @@ -3,7 +3,7 @@ become: true become_user: "{{ weechat.user }}" file: - path: "{{ weechat.home_directory }}" + path: "{{ weechat.home_directory }}/.weechat" state: directory owner: "{{ weechat.user }}" mode: "0750" @@ -12,7 +12,7 @@ become: true become_user: "{{ weechat.user }}" file: - path: "{{ weechat.home_directory }}/{{ item.value }}/autoload" + path: "{{ weechat.home_directory }}/.weechat/{{ item.value }}/autoload" state: directory owner: "{{ weechat.user }}" mode: "0750" @@ -21,12 +21,12 @@ - name: download weechat plugins get_url: 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 }}' - name: symlinking plugins to autoload file: - src: "{{ weechat.home_directory }}/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" - dest: "{{ weechat.home_directory }}/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/autoload/{{ item }}" + src: "{{ weechat.home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" + dest: "{{ weechat.home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/autoload/{{ item }}" state: link with_items: '{{ weechat.plugins }}' diff --git a/vars/main.yml b/vars/main.yml index db5cfbc..aa6bbc3 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -18,7 +18,7 @@ _weechat: autostart: false install_plugins: false user: "{{ ansible_user_id }}" - home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}/.weechat" + home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}" plugins: [] gpg_id: '11E9DE8848F2B65222AA75B8D1820DB22A11534E' use_custom_config: false