From e271f5cc448e5a95d63e0c659afc6be26acd103d Mon Sep 17 00:00:00 2001 From: "ansible-code-bot[bot]" <145416087+ansible-code-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:29:38 +0000 Subject: [PATCH] Fix ansible-lint rule violations --- galaxy.yml | 5 ++- meta/runtime.yml | 2 +- roles/atuin_client/defaults/main.yml | 34 +++++++++---------- roles/atuin_client/meta/main.yml | 1 + .../molecule/default/converge.yml | 3 +- .../molecule/default/molecule.yml | 8 ++--- .../atuin_client/molecule/default/prepare.yml | 1 + .../atuin_client/molecule/default/verify.yml | 1 + roles/atuin_client/tasks/main.yml | 18 +++++----- roles/atuin_client/tasks/users.yml | 1 + roles/atuin_server/handlers/main.yml | 4 +-- roles/atuin_server/meta/main.yml | 1 + .../molecule/default/converge.yml | 5 +-- .../molecule/default/molecule.yml | 8 ++--- .../atuin_server/molecule/default/prepare.yml | 1 + .../molecule/default/requirements.yml | 1 + .../atuin_server/molecule/default/verify.yml | 1 + roles/atuin_server/tasks/create_user.yml | 8 ++--- roles/atuin_server/tasks/main.yml | 12 +++---- roles/atuin_server/tasks/systemd_unit.yml | 8 ++--- 20 files changed, 65 insertions(+), 58 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 0b8d865..282d735 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,3 +1,4 @@ +--- ### REQUIRED # The namespace of the collection. This can be a company/brand/organization or product namespace under which all # content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with @@ -8,7 +9,7 @@ namespace: wzzrd name: atuin # The version of the collection. Must be compatible with semantic versioning -version: "2.1.1" +version: 2.1.1 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md @@ -18,7 +19,6 @@ readme: README.md authors: - Maxim Burgerhout - ### OPTIONAL but strongly recommended # A short summary description of the collection description: Install and manage atuin on your systems @@ -37,7 +37,6 @@ tags: - tools dependencies: {} - repository: https://github.com/wzzrd/ansible-collection-atuin documentation: https://github.com/wzzrd/ansible-collection-atuin diff --git a/meta/runtime.yml b/meta/runtime.yml index f3589f4..060499f 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,7 +1,7 @@ --- # Collections must specify a minimum required ansible version to upload # to galaxy -requires_ansible: '>=2.15.0' +requires_ansible: ">=2.15.0" # Content that Ansible needs to load from another location or that has # been deprecated/removed diff --git a/roles/atuin_client/defaults/main.yml b/roles/atuin_client/defaults/main.yml index 0ba7cf3..2f117ca 100644 --- a/roles/atuin_client/defaults/main.yml +++ b/roles/atuin_client/defaults/main.yml @@ -8,22 +8,22 @@ atuin_client_bin_dir: /usr/local/bin atuin_client_libc_variant: gnu ## where to store your database, default is your system data directory -atuin_client_db_path: "~/.local/share/atuin/history.db" +atuin_client_db_path: ~/.local/share/atuin/history.db ## where to store your encryption key, default is your system data directory -atuin_client_key_path: "~/.local/share/atuin/key" +atuin_client_key_path: ~/.local/share/atuin/key ## where to store your auth session token, default is your system data directory -atuin_client_session_path: "~/.local/share/atuin/session" +atuin_client_session_path: ~/.local/share/atuin/session ## date format used, either "us" or "uk" -atuin_client_dialect: "uk" +atuin_client_dialect: uk ## default timezone to use when displaying time ## either "l", "local" to use the system's current local timezone, or an offset ## from UTC in the format of "<+|->H[H][:M[M][:S[S]]]" ## for example: "+9", "-05", "+03:30", "-01:23:45", etc. -atuin_client_timezone: "local" +atuin_client_timezone: local ## enable or disable automatic sync atuin_client_auto_sync: true @@ -32,20 +32,20 @@ atuin_client_auto_sync: true atuin_client_update_check: true ## address of the sync server -atuin_client_sync_address: "https://api.atuin.sh" +atuin_client_sync_address: https://api.atuin.sh ## how often to sync history. note that this is only triggered when a command ## is ran, so sync intervals may well be longer ## set it to 0 to sync after every command -atuin_client_sync_frequency: "10m" +atuin_client_sync_frequency: 10m ## which search mode to use ## possible values: prefix, fulltext, fuzzy, skim -atuin_client_search_mode: "fuzzy" +atuin_client_search_mode: fuzzy ## which filter mode to use ## possible values: global, host, session, directory -atuin_client_filter_mode: "global" +atuin_client_filter_mode: global ## With workspace filtering enabled, Atuin will filter for commands executed ## in any directory within a git repository tree (default: false) @@ -54,16 +54,16 @@ atuin_client_workspaces: false ## which filter mode to use when atuin is invoked from a shell up-key binding ## the accepted values are identical to those of "filter_mode" ## leave unspecified to use same mode set in "filter_mode" -atuin_client_filter_mode_shell_up_key_binding: "global" +atuin_client_filter_mode_shell_up_key_binding: global ## which search mode to use when atuin is invoked from a shell up-key binding ## the accepted values are identical to those of "search_mode" ## leave unspecified to use same mode set in "search_mode" -atuin_client_search_mode_shell_up_key_binding: "fuzzy" +atuin_client_search_mode_shell_up_key_binding: fuzzy ## which style to use ## possible values: auto, full, compact -atuin_client_style: "auto" +atuin_client_style: auto ## the maximum number of lines the interface should take up ## set it to 0 to always go full screen @@ -78,13 +78,13 @@ atuin_client_show_preview: false ## what to do when the escape key is pressed when searching ## possible values: return-original, return-query -atuin_client_exit_mode: "return-original" +atuin_client_exit_mode: return-original ## possible values: emacs, subl -atuin_client_word_jump_mode: "emacs" +atuin_client_word_jump_mode: emacs ## characters that count as a part of a word -atuin_client_word_chars: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" +atuin_client_word_chars: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ## number of context lines to show when scrolling by pages atuin_client_scroll_context_lines: 1 @@ -145,7 +145,7 @@ atuin_client_enter_accept: true ## keybinding is defined. If this is set to "emacs", "vim-insert", or ## "vim-normal", the startup keymap mode in the Atuin search is forced to be ## the specified one. -atuin_client_keymap_mode: "auto" +atuin_client_keymap_mode: auto ## Cursor style in each keymap mode. If specified, the cursor style is changed ## in entering the cursor shape. Available values are "default" and @@ -176,4 +176,4 @@ atuin_client_common_subcommands: | ] # Set commands that should be totally stripped and ignored from stats -atuin_client_common_prefix: ["sudo"] +atuin_client_common_prefix: [sudo] diff --git a/roles/atuin_client/meta/main.yml b/roles/atuin_client/meta/main.yml index 97c5000..3dd9046 100644 --- a/roles/atuin_client/meta/main.yml +++ b/roles/atuin_client/meta/main.yml @@ -1,3 +1,4 @@ +--- galaxy_info: author: Maxim Burgerhout description: Role to deploy the atuin shell history tool diff --git a/roles/atuin_client/molecule/default/converge.yml b/roles/atuin_client/molecule/default/converge.yml index 9e537fb..d3a4529 100644 --- a/roles/atuin_client/molecule/default/converge.yml +++ b/roles/atuin_client/molecule/default/converge.yml @@ -1,3 +1,4 @@ +--- - name: Converge hosts: all # We disable gather facts because it would fail due to our container not @@ -9,7 +10,7 @@ - name: Gather required subset of facts ansible.builtin.setup: gather_subset: - - '!all' + - "!all" roles: - role: atuin_client diff --git a/roles/atuin_client/molecule/default/molecule.yml b/roles/atuin_client/molecule/default/molecule.yml index caab4b2..8b2fd42 100644 --- a/roles/atuin_client/molecule/default/molecule.yml +++ b/roles/atuin_client/molecule/default/molecule.yml @@ -10,7 +10,7 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true - command: "/usr/sbin/init" + command: /usr/sbin/init platform: linux/amd64 - name: ubi9 image: registry.access.redhat.com/ubi9/ubi-init:latest @@ -19,15 +19,15 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw privileged: true - command: "/usr/sbin/init" + command: /usr/sbin/init platform: linux/amd64 provisioner: name: ansible inventory: host_vars: ubi8: - atuin_client_libc_variant: "musl" + atuin_client_libc_variant: musl ubi9: - atuin_client_libc_variant: "gnu" + atuin_client_libc_variant: gnu verifier: name: ansible diff --git a/roles/atuin_client/molecule/default/prepare.yml b/roles/atuin_client/molecule/default/prepare.yml index 0bac5a7..ae03cf3 100644 --- a/roles/atuin_client/molecule/default/prepare.yml +++ b/roles/atuin_client/molecule/default/prepare.yml @@ -1,3 +1,4 @@ +--- - name: Prepare containers for molecule tests hosts: all gather_facts: false diff --git a/roles/atuin_client/molecule/default/verify.yml b/roles/atuin_client/molecule/default/verify.yml index f970fa8..5c1d304 100644 --- a/roles/atuin_client/molecule/default/verify.yml +++ b/roles/atuin_client/molecule/default/verify.yml @@ -1,3 +1,4 @@ +--- - name: Verify hosts: all # We disable gather facts because it would fail due to our container not diff --git a/roles/atuin_client/tasks/main.yml b/roles/atuin_client/tasks/main.yml index 816e586..fb76562 100644 --- a/roles/atuin_client/tasks/main.yml +++ b/roles/atuin_client/tasks/main.yml @@ -36,15 +36,14 @@ - name: Download and install new binary, if needed, for old atuin when: - - (detected_version is not defined) or - (atuin_client_version != detected_version) + - (detected_version is not defined) or (atuin_client_version != detected_version) - atuin_client_version is version('18.3.0', '<') tags: - version block: - name: Formulate artifact name ansible.builtin.set_fact: - atuin_client_artifact: atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}.tar.gz # noqa yaml[line-length] + atuin_client_artifact: atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}.tar.gz # noqa yaml[line-length] - name: Show artifact name ansible.builtin.debug: @@ -57,8 +56,8 @@ ansible.builtin.unarchive: src: https://github.com/atuinsh/atuin/releases/download/v{{ atuin_client_version }}/{{ atuin_client_artifact }} # noqa yaml[line-length]. remote_src: true - dest: "/tmp" - include: "atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin" # noqa yaml[line-length] + dest: /tmp + include: atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin # noqa yaml[line-length] owner: root group: root mode: "0755" @@ -82,15 +81,14 @@ - name: Download and install new binary, if needed, for new atuin when: - - (detected_version is not defined) or - (atuin_client_version != detected_version) + - (detected_version is not defined) or (atuin_client_version != detected_version) - atuin_client_version is version('18.3.0', '>=') tags: - version block: - name: Formulate artifact name ansible.builtin.set_fact: - atuin_client_artifact: atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}.tar.gz # noqa yaml[line-length] + atuin_client_artifact: atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}.tar.gz # noqa yaml[line-length] - name: Show artifact name ansible.builtin.debug: @@ -103,8 +101,8 @@ ansible.builtin.unarchive: src: https://github.com/atuinsh/atuin/releases/download/v{{ atuin_client_version }}/{{ atuin_client_artifact }} # noqa yaml[line-length]. remote_src: true - dest: "/tmp" - include: "atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin" # noqa yaml[line-length] + dest: /tmp + include: atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin # noqa yaml[line-length] owner: root group: root mode: "0755" diff --git a/roles/atuin_client/tasks/users.yml b/roles/atuin_client/tasks/users.yml index 825a01a..57d2017 100644 --- a/roles/atuin_client/tasks/users.yml +++ b/roles/atuin_client/tasks/users.yml @@ -1,3 +1,4 @@ +--- - name: Get user info for {{ item }} ansible.builtin.getent: database: passwd diff --git a/roles/atuin_server/handlers/main.yml b/roles/atuin_server/handlers/main.yml index e70b5d9..150ad1d 100644 --- a/roles/atuin_server/handlers/main.yml +++ b/roles/atuin_server/handlers/main.yml @@ -1,9 +1,9 @@ --- -- name: "Restart atuin" +- name: Restart atuin ansible.builtin.service: name: atuin state: restarted -- name: "Reload systemd" +- name: Reload systemd ansible.builtin.systemd: daemon_reload: true diff --git a/roles/atuin_server/meta/main.yml b/roles/atuin_server/meta/main.yml index ea72a77..1a860f4 100644 --- a/roles/atuin_server/meta/main.yml +++ b/roles/atuin_server/meta/main.yml @@ -1,3 +1,4 @@ +--- galaxy_info: author: Maxim Burgerhout description: Role to deploy the atuin shell history tool, server component diff --git a/roles/atuin_server/molecule/default/converge.yml b/roles/atuin_server/molecule/default/converge.yml index 2b4da51..a4a4737 100644 --- a/roles/atuin_server/molecule/default/converge.yml +++ b/roles/atuin_server/molecule/default/converge.yml @@ -1,3 +1,4 @@ +--- - name: Converge server hosts: all # We disable gather facts because it would fail due to our container not @@ -7,13 +8,13 @@ gather_facts: false vars: atuin_client_version: 18.3.0 - atuin_server_db_uri: "postgres://atuin:atuin@{{ atuin_server_host }}/atuin" + atuin_server_db_uri: postgres://atuin:atuin@{{ atuin_server_host }}/atuin pre_tasks: - name: Gather required subset of facts ansible.builtin.setup: gather_subset: - - '!all' + - "!all" - default_ipv4 roles: diff --git a/roles/atuin_server/molecule/default/molecule.yml b/roles/atuin_server/molecule/default/molecule.yml index b3e9a53..82e836a 100644 --- a/roles/atuin_server/molecule/default/molecule.yml +++ b/roles/atuin_server/molecule/default/molecule.yml @@ -11,7 +11,7 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw privileged: true - command: "/usr/sbin/init" + command: /usr/sbin/init platform: linux/amd64 - name: ubi9 image: registry.access.redhat.com/ubi9/ubi-init:latest @@ -20,15 +20,15 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw privileged: true - command: "/usr/sbin/init" + command: /usr/sbin/init platform: linux/amd64 provisioner: name: ansible inventory: host_vars: ubi8: - atuin_client_libc_variant: "musl" + atuin_client_libc_variant: musl ubi9: - atuin_client_libc_variant: "gnu" + atuin_client_libc_variant: gnu verifier: name: ansible diff --git a/roles/atuin_server/molecule/default/prepare.yml b/roles/atuin_server/molecule/default/prepare.yml index 5825020..59ad7b3 100644 --- a/roles/atuin_server/molecule/default/prepare.yml +++ b/roles/atuin_server/molecule/default/prepare.yml @@ -1,3 +1,4 @@ +--- - name: Prepare containers for molecule tests hosts: ubi8 gather_facts: false diff --git a/roles/atuin_server/molecule/default/requirements.yml b/roles/atuin_server/molecule/default/requirements.yml index 6c36796..68b4a8e 100644 --- a/roles/atuin_server/molecule/default/requirements.yml +++ b/roles/atuin_server/molecule/default/requirements.yml @@ -1,2 +1,3 @@ +--- collections: - containers.podman diff --git a/roles/atuin_server/molecule/default/verify.yml b/roles/atuin_server/molecule/default/verify.yml index 0c8aa2f..a9cf3c1 100644 --- a/roles/atuin_server/molecule/default/verify.yml +++ b/roles/atuin_server/molecule/default/verify.yml @@ -1,3 +1,4 @@ +--- - name: Verify hosts: all # We disable gather facts because it would fail due to our container not diff --git a/roles/atuin_server/tasks/create_user.yml b/roles/atuin_server/tasks/create_user.yml index 63dda6f..7cf9a12 100644 --- a/roles/atuin_server/tasks/create_user.yml +++ b/roles/atuin_server/tasks/create_user.yml @@ -1,14 +1,14 @@ --- -- name: "Create atuin group" +- name: Create atuin group ansible.builtin.group: name: "{{ atuin_server_group }}" system: true - state: "present" + state: present -- name: "Create atuin user" +- name: Create atuin user ansible.builtin.user: name: "{{ atuin_server_user }}" - comment: "atuin server user" + comment: atuin server user group: "{{ atuin_server_group }}" home: "{{ atuin_server_home }}" shell: /sbin/nologin diff --git a/roles/atuin_server/tasks/main.yml b/roles/atuin_server/tasks/main.yml index cf773c9..f07d37a 100644 --- a/roles/atuin_server/tasks/main.yml +++ b/roles/atuin_server/tasks/main.yml @@ -3,18 +3,18 @@ - name: Include user creation tasks ansible.builtin.include_tasks: create_user.yml -- name: "Create atuin home directory" +- name: Create atuin home directory ansible.builtin.file: path: "{{ atuin_server_home }}" state: directory owner: "{{ atuin_server_user }}" group: "{{ atuin_server_group }}" - mode: '0755' + mode: "0755" - name: Include systemd unit file tasks ansible.builtin.include_tasks: systemd_unit.yml -- name: "Create atuin config directory" +- name: Create atuin config directory ansible.builtin.file: path: "{{ atuin_server_home }}/.config/atuin" state: directory @@ -22,16 +22,16 @@ group: "{{ atuin_server_group }}" mode: "0750" -- name: "Configure atuin" +- name: Configure atuin ansible.builtin.template: src: server.toml.j2 dest: "{{ atuin_server_home }}/.config/atuin/server.toml" owner: "{{ atuin_server_user }}" group: "{{ atuin_server_group }}" mode: "0600" - notify: "Restart atuin" + notify: Restart atuin -- name: "Service atuin" +- name: Service atuin ansible.builtin.service: name: atuin state: started diff --git a/roles/atuin_server/tasks/systemd_unit.yml b/roles/atuin_server/tasks/systemd_unit.yml index 5bbe0f5..905b79a 100644 --- a/roles/atuin_server/tasks/systemd_unit.yml +++ b/roles/atuin_server/tasks/systemd_unit.yml @@ -1,5 +1,5 @@ --- -- name: "Setup systemd service" +- name: Setup systemd service ansible.builtin.template: src: atuin.service.j2 dest: /etc/systemd/system/atuin.service @@ -7,9 +7,9 @@ group: root mode: "0644" notify: - - "Reload systemd" - - "Restart atuin" + - Reload systemd + - Restart atuin -- name: "Reload systemd" +- name: Reload systemd ansible.builtin.systemd: daemon_reload: true