Skip to content

Commit

Permalink
ansible: fix yamllint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gelocraft committed Dec 12, 2024
1 parent 6188801 commit 080a6ae
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 19 deletions.
4 changes: 2 additions & 2 deletions ansible/playbook.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- hosts: all
become: yes
become: true
vars:
username: gelocraft
pre_tasks:
- name: Update and Upgrade packages
when: ansible_distribution in ["Debian", "Ubuntu"]
ansible.builtin.apt:
upgrade: dist
update_cache: yes
update_cache: true

- name: Create User
ansible.builtin.user:
Expand Down
6 changes: 4 additions & 2 deletions ansible/roles/docker/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

- name: Add Docker APT repository
ansible.builtin.apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
repo: >
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
{{ ansible_lsb.codename }} stable"
state: present

- name: Install Docker
Expand All @@ -26,5 +28,5 @@
- name: Start and enable Docker service
ansible.builtin.systemd:
name: docker
enabled: yes
enabled: true
state: started
1 change: 1 addition & 0 deletions ansible/roles/git/tasks/install.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Install git
ansible.builtin.package:
name: git
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/git/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
- ansible.builtin.import_tasks: install.yaml
- ansible.builtin.import_tasks: setup.yaml
6 changes: 3 additions & 3 deletions ansible/roles/golang/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
ansible.builtin.unarchive:
src: /tmp/go.tar.gz
dest: /usr/local
remote_src: yes
remote_src: true

- name: Create a symbolic link for Go binary
ansible.builtin.file:
src: /usr/local/go/bin/go
dest: /usr/local/bin/go
state: link
force: yes
force: true

- name: Add Go to the system PATH
ansible.builtin.lineinfile:
path: /etc/profile.d/go.sh
line: 'export PATH=$PATH:/usr/local/go/bin'
create: yes
create: true

- name: Apply updated PATH
ansible.builtin.shell: ". /etc/profile.d/go.sh"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/golang/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
go_version: 1.23.2
go_download_url: "https://go.dev/dl/go{{ go_version }}.linux-amd64.tar.gz"
2 changes: 1 addition & 1 deletion ansible/roles/lsp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
state: present

- name: Install typescript-language-server
ansible.builtin.command:
ansible.builtin.command:
cmd: "npm install -g typescript typescript-language-server"
creates: "/usr/bin/typescript-language-server"
4 changes: 3 additions & 1 deletion ansible/roles/minikube/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
minikube_deb_url: "https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb"
---
minikube_deb_url: >
"https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb"
minikube_deb_path: "/tmp/minikube_latest_amd64.deb"
2 changes: 1 addition & 1 deletion ansible/roles/neovim/tasks/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- name: Update apt package index
ansible.builtin.apt:
update_cache: yes
update_cache: true

- name: Install Neovim Nightly
ansible.builtin.apt:
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/neovim/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
- ansible.builtin.import_tasks: install.yaml
- ansible.builtin.import_tasks: setup.yaml
1 change: 1 addition & 0 deletions ansible/roles/neovim/tasks/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Create XDG_CONFIG_HOME directory
ansible.builtin.file:
path: "~/.config"
Expand Down
13 changes: 8 additions & 5 deletions ansible/roles/nodejs/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
- name: Download and execute the NodeSource setup script for Node.js {{ nodejs_major_version }}.x
ansible.builtin.shell: |
curl -fsSL https://deb.nodesource.com/setup_{{ nodejs_major_version }}.x | bash -
- name: >
"Download and execute the NodeSource
setup script for Node.js {{ nodejs_major_version }}.x"
ansible.builtin.shell: >
"curl -fsSL https://deb.nodesource.com\
/setup_{{ nodejs_major_version }}.x | bash -"
args:
creates: /usr/bin/node # Ensures this task only runs if /usr/bin/node doesn't exist
creates: /usr/bin/node

- name: Install Node.js
ansible.builtin.apt:
name: nodejs
state: latest
update_cache: yes
update_cache: true
1 change: 1 addition & 0 deletions ansible/roles/nodejs/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
nodejs_major_version: 22
2 changes: 1 addition & 1 deletion ansible/roles/stylua/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ansible.builtin.unarchive:
src: "/tmp/{{ stylua_compress_file }}"
dest: /usr/local/bin
remote_src: yes
remote_src: true

- name: Verify Stylua installation
ansible.builtin.shell: stylua --version
Expand Down
6 changes: 5 additions & 1 deletion ansible/roles/stylua/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
stylua_remote_url: "https://github.com"
stylua_repository: "JohnnyMorganz/StyLua"
stylua_release_tag: "v2.0.1"
stylua_compress_file: "stylua-linux-x86_64.zip"
stylua_download_url: "{{ stylua_remote_url }}/{{ stylua_repository }}/releases/download/{{ stylua_release_tag }}/{{ stylua_compress_file }}"
stylua_download_url: >
"{{ stylua_remote_url }}/\
{{ stylua_repository }}/releases/download/\
{{ stylua_release_tag }}/{{ stylua_compress_file }}"
6 changes: 4 additions & 2 deletions ansible/roles/terraform/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

- name: Add HashiCorp APT repository
ansible.builtin.apt_repository:
repo: "deb https://apt.releases.hashicorp.com {{ ansible_lsb.codename }} main"
repo: >
"deb https://apt.releases.hashicorp.codename
{{ ansible_lsb.codename }} main"
state: present

- name: Ensure apt cache is updated
ansible.builtin.apt:
update_cache: yes
update_cache: true

- name: Install Terraform
ansible.builtin.apt:
Expand Down

0 comments on commit 080a6ae

Please sign in to comment.