Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting issues #147

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
exclude_paths:
- .ansible
- .venv
- molecule/*/converge.yml
parseable: true
skip_list:
- "empty-string-compare"
11 changes: 6 additions & 5 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- name: Get list of installed Nix packages
become: true
become_user: "{{ nix_user }}"
shell: "nix-env --query --installed"
ansible.builtin.command: "nix-env --query --installed"
environment:
PATH: "/home/{{ nix_user }}/.nix-profile/bin:{{ lookup('env', 'PATH') }}"
changed_when: false
Expand All @@ -22,29 +22,30 @@
- name: Try to install a Nix package
become: true
become_user: "{{ nix_user }}"
shell: "nix-env -i hello"
ansible.builtin.command: "nix-env -i hello"
environment:
PATH: "/home/{{ nix_user }}/.nix-profile/bin:{{ lookup('env', 'PATH') }}"
when: "'hello' not in nix_packages.stdout"
changed_when: true

- name: Try to run the hello Nix package
become: true
become_user: "{{ nix_user }}"
command: "hello"
ansible.builtin.command: "hello"
environment:
PATH: "/home/{{ nix_user }}/.nix-profile/bin:{{ lookup('env', 'PATH') }}"
changed_when: false
register: hello_output

- name: Verify output of the hello program
fail:
ansible.builtin.fail:
msg: "The hello program did not return the expected output!"
when: "hello_output.stdout != 'Hello, world!'"

- name: Try to use Nix Flakes
become: true
become_user: "{{ nix_user }}"
shell: "nix flake metadata github:edolstra/dwarffs"
ansible.builtin.command: "nix flake metadata github:edolstra/dwarffs"
environment:
PATH: "/home/{{ nix_user }}/.nix-profile/bin:{{ lookup('env', 'PATH') }}"
changed_when: false
2 changes: 2 additions & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ ansible-core
ansible-lint
molecule
molecule-plugins[docker]
# https://github.com/docker/docker-py/issues/3113
urllib3<2
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ text-unidecode==1.3
# via python-slugify
tomli==2.0.1
# via black
urllib3==2.0.3
urllib3==1.26.16
# via
# -r requirements-dev.in
# docker
# requests
wcmatch==8.4.1
Expand Down