Skip to content

Commit

Permalink
Merge pull request #147 from staticdev/bugfix/linting-issues
Browse files Browse the repository at this point in the history
Fix linting issues
  • Loading branch information
nre-ableton committed Jul 12, 2023
2 parents b583891 + 39408ac commit b60770e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
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

0 comments on commit b60770e

Please sign in to comment.