diff --git a/README.md b/README.md index 1972089..b601f42 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ None. ```yaml - hosts: all - become: true roles: - bleetube.dotfiles ``` diff --git a/tasks/ArchLinux.yml b/tasks/ArchLinux.yml index cc33a08..76c9c66 100644 --- a/tasks/ArchLinux.yml +++ b/tasks/ArchLinux.yml @@ -1,6 +1,11 @@ --- - import_tasks: vim.yml +- name: Copy the global vim configuration + ansible.builtin.copy: + src: vimrc.local + dest: /etc/ + - name: Ensure Arch Linux sources bash_aliases lineinfile: path: /root/.bashrc @@ -15,7 +20,7 @@ loop: - /etc/skel - /root - - "{{ ansible_env.HOME }}/" + - "{{ ansible_env.PWD }}/" - name: Copy bash aliases ansible.builtin.copy: @@ -24,7 +29,7 @@ loop: - /etc/skel - /root - - "{{ ansible_env.HOME }}/" + - "{{ ansible_env.PWD }}/" - name: Add root bashrc shell history configuration lineinfile: diff --git a/tasks/Debian.yml b/tasks/Debian.yml index c871bd2..517e0ca 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -1,9 +1,14 @@ --- - import_tasks: vim.yml +- name: Copy the global vim configuration + ansible.builtin.copy: + src: vimrc.local + dest: /etc/vim/ + - name: Ensure vim will source a global configuration file ansible.builtin.blockinfile: - path: /etc/vimrc + path: /etc/vim/vimrc marker: '" {mark} ANSIBLE MANAGED BLOCK' block: | set runtimepath+=/var/lib/vim/addons @@ -24,7 +29,7 @@ loop: - /etc/skel - /root - - "{{ ansible_env.HOME }}/" + - "{{ ansible_env.PWD }}/" - name: Copy bash aliases ansible.builtin.copy: diff --git a/tasks/RedHat-7.yml b/tasks/RedHat-7.yml index 080f569..9277419 100644 --- a/tasks/RedHat-7.yml +++ b/tasks/RedHat-7.yml @@ -1,6 +1,11 @@ --- - import_tasks: vim.yml +- name: Copy the global vim configuration + ansible.builtin.copy: + src: vimrc.local + dest: /etc/ + - name: Copy shell configuration ansible.builtin.copy: src: inputrc diff --git a/tasks/Ubuntu.yml b/tasks/Ubuntu.yml index dd2b794..1a137e1 100644 --- a/tasks/Ubuntu.yml +++ b/tasks/Ubuntu.yml @@ -1,9 +1,14 @@ --- - import_tasks: vim.yml +- name: Copy the global vim configuration + ansible.builtin.copy: + src: vimrc.local + dest: /etc/vim/ + - name: Ensure vim will source a global configuration file ansible.builtin.blockinfile: - path: /etc/vimrc + path: /etc/vim/vimrc marker: '" {mark} ANSIBLE MANAGED BLOCK' block: | set runtimepath+=/var/lib/vim/addons diff --git a/tasks/default.yml b/tasks/default.yml index f2e2b64..fac6c0f 100644 --- a/tasks/default.yml +++ b/tasks/default.yml @@ -1,6 +1,11 @@ --- - import_tasks: vim.yml +- name: Copy the global vim configuration + ansible.builtin.copy: + src: vimrc.local + dest: /etc/ + - name: Copy shell configuration ansible.builtin.copy: src: inputrc @@ -8,7 +13,7 @@ loop: - /etc/skel - /root - - "{{ ansible_env.HOME }}/" + - "{{ ansible_env.PWD }}/" - name: Copy bash aliases ansible.builtin.copy: diff --git a/tasks/main.yml b/tasks/main.yml index 92d0816..d61e34e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,9 +4,15 @@ msg: "{{ ansible_distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - name: Run tasks based on the OS type, or a default if not found. - include_tasks: "{{ item }}" + include_tasks: + file: "{{ task_target }}" + apply: + become: yes + loop_control: + loop_var: task_target with_first_found: - "{{ ansible_distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" - "default.yml" + diff --git a/tasks/vim.yml b/tasks/vim.yml index 8cf4a49..83f35a3 100644 --- a/tasks/vim.yml +++ b/tasks/vim.yml @@ -8,8 +8,3 @@ ansible.builtin.copy: src: ir_black.vim dest: /var/lib/vim/addons/colors/ - -- name: Copy the global vim configuration - ansible.builtin.copy: - src: vimrc.local - dest: /etc/