Skip to content

Commit

Permalink
refactor: prepare for more lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rudenkornk committed Apr 14, 2024
1 parent 736520c commit 66c63ea
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions roles/cpp/tasks/cmake.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Download cmake installation script
- name: cmake | Download installation script
ansible.builtin.get_url:
url: "{{ manifest.cmake.url }}"
dest: "{{ dotfiles_tmp }}/cmake.sh"
Expand All @@ -9,7 +9,7 @@
register: cpp_downloaded
until: cpp_downloaded is not failed

- name: Install cmake
- name: cmake | Install cmake
become: true
ansible.builtin.shell: |
set -o pipefail
Expand Down
18 changes: 9 additions & 9 deletions roles/cpp/tasks/gcc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Add toolchain-r gpg key
- name: gcc | Add toolchain-r gpg key
become: true
ansible.builtin.get_url:
url: "{{ cpp_toolchain_r_key_url }}"
Expand All @@ -11,32 +11,32 @@
# As a workaround we set `changed_when` to false
changed_when: false

- name: Remove default toolchain-r repository
- name: gcc | Remove default toolchain-r repository
become: true
ansible.builtin.file:
dest: "{{ cpp_toolchain_r_default_path }}"
state: absent

- name: Add toolchain-r repository
- name: gcc | Add toolchain-r repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64 signed-by={{ apt_keys }}/toolchain-r.asc] {{ cpp_toolchain_r_repo }}
{{ ansible_distribution_release }} main

- name: Add toolchain-r src repository
- name: gcc | Add toolchain-r src repository
become: true
ansible.builtin.apt_repository:
repo: deb-src [arch=amd64 signed-by={{ apt_keys }}/toolchain-r.asc] {{ cpp_toolchain_r_repo }}
{{ ansible_distribution_release }} main

- name: Install GCC
- name: gcc | Install GCC
become: true
ansible.builtin.apt:
name:
- gcc-{{ cpp_gcc_version }}
- g++-{{ cpp_gcc_version }}

- name: Update GCC alternatives
- name: gcc | Update GCC alternatives
become: true
community.general.alternatives:
name: gcc
Expand Down Expand Up @@ -69,15 +69,15 @@
link: /usr/bin/lto-dump
path: /usr/bin/lto-dump-{{ cpp_gcc_version }}

- name: Update cc alternative
- name: gcc | Update cc alternative
become: true
community.general.alternatives:
name: cc
link: /usr/bin/cc
path: /usr/bin/gcc-{{ cpp_gcc_version }}
priority: "{{ cpp_gcc_version }}0"

- name: Fix cyclic cpp symlinks
- name: gcc | Fix cyclic cpp symlinks
become: true
ansible.builtin.shell: |
set -o pipefail
Expand All @@ -90,7 +90,7 @@
register: cpp_output
changed_when: '"changed" in cpp_output.stdout'

- name: Update cpp alternative
- name: gcc | Update cpp alternative
become: true
community.general.alternatives:
name: cpp
Expand Down
16 changes: 8 additions & 8 deletions roles/cpp/tasks/llvm.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
- name: Add LLVM gpg key
- name: llvm | Add LLVM gpg key
become: true
ansible.builtin.get_url:
url: "{{ cpp_llvm_gpg }}"
dest: "{{ apt_keys }}/llvm.asc"
mode: "0o644"

- name: Add LLVM repository
- name: llvm | Add LLVM repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64 signed-by={{ apt_keys }}/llvm.asc] {{ cpp_llvm_repo }} llvm-toolchain-{{
ansible_distribution_release }}-{{ cpp_llvm_version }} main

- name: Install LLVM
- name: llvm | Install LLVM
become: true
ansible.builtin.apt:
name:
Expand All @@ -34,7 +34,7 @@
- llvm-{{ cpp_llvm_version }}-dev
- llvm-{{ cpp_llvm_version }}-tools

- name: Update LLVM alternatives
- name: llvm | Update LLVM alternatives
become: true
community.general.alternatives:
name: clang
Expand Down Expand Up @@ -421,15 +421,15 @@
link: /usr/bin/yaml2obj
path: /usr/bin/yaml2obj-{{ cpp_llvm_version }}

- name: Update clang++ alternatives
- name: llvm | Update clang++ alternatives
become: true
community.general.alternatives:
name: clang++
link: /usr/bin/clang++
path: /usr/bin/clang++-{{ cpp_llvm_version }}
priority: "{{ cpp_llvm_version }}0"

- name: Update clang-format alternatives
- name: llvm | Update clang-format alternatives
become: true
community.general.alternatives:
name: clang-format
Expand All @@ -441,7 +441,7 @@
link: /usr/bin/clang-format-diff
path: /usr/bin/clang-format-diff-{{ cpp_llvm_version }}

- name: Update clang-tidy alternatives
- name: llvm | Update clang-tidy alternatives
become: true
community.general.alternatives:
name: clang-tidy
Expand All @@ -453,7 +453,7 @@
link: /usr/bin/clang-tidy-diff.py
path: /usr/bin/clang-tidy-diff-{{ cpp_llvm_version }}.py

- name: Update run-clang-tidy alternatives
- name: llvm | Update run-clang-tidy alternatives
become: true
community.general.alternatives:
name: run-clang-tidy
Expand Down
2 changes: 1 addition & 1 deletion roles/cpp/tasks/vcpkg.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Download vcpkg
- name: vcpkg | Download vcpkg
ansible.builtin.git:
repo: "{{ manifest.vcpkg.url }}"
dest: "{{ home }}/.local/vcpkg"
Expand Down
2 changes: 2 additions & 0 deletions roles/dotfiles/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
src: "{{ playbook_dir }}"
dest: "{{ dotfiles_parent_path }}"
rsync_opts: "--filter=':- .gitignore'"
owner: false
group: false
register: dotfiles_changed
changed_when: dotfiles_changed.stdout_lines | length >= 10

Expand Down

0 comments on commit 66c63ea

Please sign in to comment.