From 80816554aa6e409ae753172ed904031448bc25a1 Mon Sep 17 00:00:00 2001 From: Maxim Burgerhout Date: Tue, 13 Feb 2024 22:58:51 +0100 Subject: [PATCH] clean up --- galaxy.yml | 27 +++------ roles/atuin_client/defaults/main.yml | 2 +- roles/atuin_client/meta/main.yml | 57 +++++-------------- roles/atuin_client/molecule/docker/verify.yml | 5 ++ .../atuin_client/molecule/podman/converge.yml | 1 - .../atuin_client/molecule/podman/molecule.yml | 11 +++- roles/atuin_client/molecule/podman/verify.yml | 7 ++- roles/atuin_client/tasks/main.yml | 3 +- roles/atuin_client/tests/inventory | 2 - roles/atuin_client/tests/test.yml | 5 -- 10 files changed, 42 insertions(+), 78 deletions(-) delete mode 100644 roles/atuin_client/tests/inventory delete mode 100644 roles/atuin_client/tests/test.yml diff --git a/galaxy.yml b/galaxy.yml index 216bcd0..580be2d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: wzzrd name: atuin # The version of the collection. Must be compatible with semantic versioning -version: 0.5.1 +version: 0.5.2 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md @@ -26,33 +26,22 @@ description: Install and manage atuin on your systems # Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only # accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' license: -- GPL-2.0-or-later - -# The path to the license file for the collection. This path is relative to the root of the collection. This key is -# mutually exclusive with 'license' -license_file: '' +- BSD-3-Clause # A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character # requirements as 'namespace' and 'name' -tags: [] +tags: + - atuin -# Collections that this collection requires to be installed for it to be usable. The key of the dict is the -# collection label 'namespace.name'. The value is a version range -# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version -# range specifiers can be set and are separated by ',' dependencies: {} -# The URL of the originating SCM repository -repository: http://example.com/repository +repository: https://github.com/wzzrd/ansible-collection-atuin -# The URL to any online docs -documentation: http://docs.example.com +documentation: https://github.com/wzzrd/ansible-collection-atuin -# The URL to the homepage of the collection/project -homepage: http://example.com +homepage: https://github.com/wzzrd/ansible-collection-atuin -# The URL to the collection issue tracker -issues: http://example.com/issue/tracker +issues: https://github.com/wzzrd/ansible-collection-atuin/issues # A list of file glob-like patterns used to filter any files or directories that should not be included in the build # artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This diff --git a/roles/atuin_client/defaults/main.yml b/roles/atuin_client/defaults/main.yml index c716c23..5a17e9f 100644 --- a/roles/atuin_client/defaults/main.yml +++ b/roles/atuin_client/defaults/main.yml @@ -1,4 +1,4 @@ --- # defaults file for atuin_client atuin_client_bin_dir: /usr/local/bin -atuin_client_libc_variant: gnu \ No newline at end of file +atuin_client_libc_variant: gnu diff --git a/roles/atuin_client/meta/main.yml b/roles/atuin_client/meta/main.yml index c572acc..97c5000 100644 --- a/roles/atuin_client/meta/main.yml +++ b/roles/atuin_client/meta/main.yml @@ -1,52 +1,21 @@ galaxy_info: - author: your name - description: your role description - company: your company (optional) + author: Maxim Burgerhout + description: Role to deploy the atuin shell history tool + company: None - # If the issue tracker for your role is not on github, uncomment the - # next line and provide a value - # issue_tracker_url: http://example.com/issue/tracker + issue_tracker_url: https://github.com/wzzrd/ansible-collection-atuin/issues - # Choose a valid license ID from https://spdx.org - some suggested licenses: - # - BSD-3-Clause (default) - # - MIT - # - GPL-2.0-or-later - # - GPL-3.0-only - # - Apache-2.0 - # - CC-BY-4.0 - license: license (GPL-2.0-or-later, MIT, etc) + license: BSD-3-Clause - min_ansible_version: 2.1 + min_ansible_version: "2.15" - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: + platforms: + - name: EL + versions: + - "8" + - "9" - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. + galaxy_tags: + - atuin dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/atuin_client/molecule/docker/verify.yml b/roles/atuin_client/molecule/docker/verify.yml index 51a8310..f970fa8 100644 --- a/roles/atuin_client/molecule/docker/verify.yml +++ b/roles/atuin_client/molecule/docker/verify.yml @@ -18,3 +18,8 @@ ansible.builtin.assert: that: - atuin_stat_result.stat.exists + + - name: Verify we can start atuin + ansible.builtin.command: + cmd: atuin --version + changed_when: false diff --git a/roles/atuin_client/molecule/podman/converge.yml b/roles/atuin_client/molecule/podman/converge.yml index dc11fde..6a27839 100644 --- a/roles/atuin_client/molecule/podman/converge.yml +++ b/roles/atuin_client/molecule/podman/converge.yml @@ -15,4 +15,3 @@ - role: atuin_client vars: atuin_client_version: 18.0.0 - diff --git a/roles/atuin_client/molecule/podman/molecule.yml b/roles/atuin_client/molecule/podman/molecule.yml index 3ec66d8..65a9b50 100644 --- a/roles/atuin_client/molecule/podman/molecule.yml +++ b/roles/atuin_client/molecule/podman/molecule.yml @@ -7,13 +7,19 @@ platforms: - name: ubi8 image: ubi8/ubi-init pre_build_image: true - rootless: true + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + command: "/usr/sbin/init" extra_opts: - --arch=x86_64 - name: ubi9 image: ubi9/ubi-init pre_build_image: true - rootless: true + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: true + command: "/usr/sbin/init" extra_opts: - --arch=x86_64 provisioner: @@ -27,7 +33,6 @@ provisioner: verifier: name: ansible driver: - name: podman options: managed: true login_cmd_template: "podman exec -ti {instance} bash" diff --git a/roles/atuin_client/molecule/podman/verify.yml b/roles/atuin_client/molecule/podman/verify.yml index df8f836..f970fa8 100644 --- a/roles/atuin_client/molecule/podman/verify.yml +++ b/roles/atuin_client/molecule/podman/verify.yml @@ -1,5 +1,5 @@ - name: Verify - hosts: molecule + hosts: all # We disable gather facts because it would fail due to our container not # having python installed. This will not prevent use from running 'raw' # commands. Most molecule users are expected to use containers that already @@ -18,3 +18,8 @@ ansible.builtin.assert: that: - atuin_stat_result.stat.exists + + - name: Verify we can start atuin + ansible.builtin.command: + cmd: atuin --version + changed_when: false diff --git a/roles/atuin_client/tasks/main.yml b/roles/atuin_client/tasks/main.yml index 8b40b7f..fd914eb 100644 --- a/roles/atuin_client/tasks/main.yml +++ b/roles/atuin_client/tasks/main.yml @@ -44,7 +44,7 @@ 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] - - name: show values + - name: Show artifact name ansible.builtin.debug: msg: "{{ atuin_client_artifact }}" when: @@ -74,4 +74,3 @@ ansible.builtin.file: path: /tmp/atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}" state: absent - diff --git a/roles/atuin_client/tests/inventory b/roles/atuin_client/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/atuin_client/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/atuin_client/tests/test.yml b/roles/atuin_client/tests/test.yml deleted file mode 100644 index 1acd9ee..0000000 --- a/roles/atuin_client/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - atuin_client