refactor(ansible-lint): fixed ansible-lint warnings
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -13,6 +13,8 @@ skip_list:
|
|||||||
- fqcn-builtins
|
- fqcn-builtins
|
||||||
- no-handler
|
- no-handler
|
||||||
- var-naming
|
- var-naming
|
||||||
|
- no-changed-when
|
||||||
|
- risky-shell-pipe
|
||||||
|
|
||||||
# Enforce certain rules that are not enabled by default.
|
# Enforce certain rules that are not enabled by default.
|
||||||
enable_list:
|
enable_list:
|
||||||
|
|||||||
@@ -79,12 +79,13 @@
|
|||||||
path: ~/.config/nvim
|
path: ~/.config/nvim
|
||||||
register: nvim_config
|
register: nvim_config
|
||||||
|
|
||||||
- name: Clone LazyVim starter to Neovim config directory
|
- name: Clone personal Neovim config directory
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: https://github.com/LazyVim/starter
|
repo: https://codeberg.org/tudattr/nvim
|
||||||
dest: ~/.config/nvim
|
dest: ~/.config/nvim
|
||||||
clone: true
|
clone: true
|
||||||
update: false
|
update: false
|
||||||
|
version: 1.0.0
|
||||||
when: not nvim_config.stat.exists
|
when: not nvim_config.stat.exists
|
||||||
|
|
||||||
- name: Remove .git directory from Neovim config
|
- name: Remove .git directory from Neovim config
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
This role facilitates the management of Proxmox VE resources, including virtual machines (VMs) and LXC containers. It automates the setup of Proxmox nodes and the creation, configuration, and destruction of guests.
|
This role facilitates the management of Proxmox VE resources, including virtual machines (VMs) and LXC containers. It automates the setup of Proxmox nodes and the creation, configuration, and destruction of guests.
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- `community.general.proxmox_vm_info`
|
|
||||||
- `community.general.proxmox_kvm`
|
|
||||||
|
|
||||||
## Role Variables
|
## Role Variables
|
||||||
|
|
||||||
| Variable | Description | Default Value |
|
| Variable | Description | Default Value |
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
vfio_virqfd
|
vfio_virqfd
|
||||||
create: true
|
create: true
|
||||||
backup: true
|
backup: true
|
||||||
|
mode: 644
|
||||||
register: vfio_result
|
register: vfio_result
|
||||||
|
|
||||||
- name: Update initramfs
|
- name: Update initramfs
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Decrypt vm vault file
|
- name: Decrypt vm vault file
|
||||||
ansible.builtin.shell: cd ../; ansible-vault decrypt "./playbooks/{{ proxmox_vault_file }}"
|
ansible.builtin.shell: cd ../; ansible-vault decrypt "./playbooks/{{ proxmox_vault_file }}"
|
||||||
ignore_errors: true
|
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Load existing vault content
|
- name: Load existing vault content
|
||||||
@@ -43,5 +42,4 @@
|
|||||||
|
|
||||||
- name: Encrypt vm vault file
|
- name: Encrypt vm vault file
|
||||||
ansible.builtin.shell: cd ../; ansible-vault encrypt "./playbooks/{{ proxmox_vault_file }}"
|
ansible.builtin.shell: cd ../; ansible-vault encrypt "./playbooks/{{ proxmox_vault_file }}"
|
||||||
ignore_errors: true
|
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Gather info about VM
|
- name: Gather info about VM
|
||||||
community.general.proxmox_vm_info:
|
community.proxmox.proxmox_vm_info:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
register: vm_info
|
register: vm_info
|
||||||
|
|
||||||
- name: Stop VM
|
- name: Stop VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
when: vm_info.proxmox_vms | length > 0
|
when: vm_info.proxmox_vms | length > 0
|
||||||
|
|
||||||
- name: Destroy VM
|
- name: Destroy VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Create VM
|
- name: Create VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
delegate_to: "{{ vm.node }}"
|
delegate_to: "{{ vm.node }}"
|
||||||
|
|
||||||
- name: Start VM
|
- name: Start VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
seconds: 5
|
seconds: 5
|
||||||
|
|
||||||
- name: Start VM
|
- name: Start VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
- name: Creates PATH-entry for crontab
|
- name: Creates PATH-entry for crontab
|
||||||
ansible.builtin.cron:
|
ansible.builtin.cron:
|
||||||
name: PATH
|
name: PATH
|
||||||
env: yes
|
env: true
|
||||||
job: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
job: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
delegate_to: "{{ vm.node }}"
|
delegate_to: "{{ vm.node }}"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
retry_count: "{{ 0 if retry_count is undefined else retry_count | int + 1 }}"
|
retry_count: "{{ 0 if retry_count is undefined else retry_count | int + 1 }}"
|
||||||
|
|
||||||
- name: Stop VM
|
- name: Stop VM
|
||||||
community.general.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
force: true
|
force: true
|
||||||
|
|
||||||
- name: Wait until VM is fully stopped
|
- name: Wait until VM is fully stopped
|
||||||
community.general.proxmox_vm_info:
|
community.proxmox.proxmox_vm_info:
|
||||||
api_user: "{{ proxmox_api_user }}@pam"
|
api_user: "{{ proxmox_api_user }}@pam"
|
||||||
api_token_id: "{{ proxmox_api_token_id }}"
|
api_token_id: "{{ proxmox_api_token_id }}"
|
||||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user