Skip to content

Commit

Permalink
Adjust to 0.94.0 (#18)
Browse files Browse the repository at this point in the history
* Remove variant selection
  • Loading branch information
Yethal authored Jun 2, 2024
1 parent 5c19c1e commit 6dfaeee
Show file tree
Hide file tree
Showing 30 changed files with 44 additions and 129 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ nu_plugins:
- nu_plugin_inc
- nu_plugin_query
- nu_plugin_formats
min_glibc_version: '2.29'
- nu_plugin_polars
config_urls:
- name: config.nu
url: "https://raw.githubusercontent.com/nushell/nushell/{{ _nushell_version }}/crates/nu-utils/src/sample_config/default_config.nu"
Expand Down
4 changes: 2 additions & 2 deletions molecule/banner/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
3 changes: 2 additions & 1 deletion molecule/banner/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
vars:
nu_users:
- ansible
nushell_binary_path: /usr/local/bin
tasks:
- name: Include default assertions
ansible.builtin.include_tasks: "../common/{{ file }}.yml"
Expand Down Expand Up @@ -43,7 +44,7 @@
loop: "{{ nu_users }}"

- name: Run nushell command to check for config errors
ansible.builtin.command: "nu -n -c 'nu-check /home/{{ item[0] }}/{{ nushell_config_path }}/{{ item[1] }}'"
ansible.builtin.command: "/usr/local/bin/nu -n -c 'nu-check /home/{{ item[0] }}/{{ nushell_config_path }}/{{ item[1] }}'"
changed_when: false
register: check_output
failed_when: check_output.stdout != 'true'
Expand Down
2 changes: 1 addition & 1 deletion molecule/common/binary.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Get nushell install path
ansible.builtin.stat:
path: "{{ nushell_binary_path }}/nu"
path: "/usr/local/bin/nu"
get_attributes: false
get_checksum: false
get_mime: false
Expand Down
2 changes: 1 addition & 1 deletion molecule/common/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Get list of registered plugins
ansible.builtin.shell: # noqa command-instead-of-shell
cmd: "version|get installed_plugins|split row ','|str trim|to json"
executable: "{{ nushell_binary_path }}/nu"
executable: "/usr/local/bin/nu"
become_user: "{{ item }}"
become: true
register: installed_plugins
Expand Down
2 changes: 1 addition & 1 deletion molecule/common/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Assert nu was not added to .profile
ansible.builtin.lineinfile:
path: "/home/{{ item }}/.profile"
line: "{{ nushell_binary_path }}/nu -l"
line: "/usr/local/bin/nu -l"
state: absent
check_mode: true
register: profile
Expand Down
4 changes: 2 additions & 2 deletions molecule/common/shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Assert nushell is not added to /etc/shells
ansible.builtin.lineinfile:
path: /etc/shells
line: "{{ nushell_binary_path }}/nu"
line: "/usr/local/bin/nu"
state: absent
check_mode: yes
register: shells
Expand All @@ -18,7 +18,7 @@

- name: Assert nushell is not set as default shell of the user
ansible.builtin.assert:
that: item.shell != "{{ nushell_binary_path }}/nu"
that: item.shell != "/usr/local/bin/nu"
quiet: true
loop: "{{ user_stats.results }}"
loop_control:
Expand Down
2 changes: 1 addition & 1 deletion molecule/common/variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Get list of features
ansible.builtin.shell: # noqa command-instead-of-shell
cmd: "version|get features"
executable: "{{ nushell_binary_path }}/nu"
executable: "/usr/local/bin/nu"
become_user: "{{ item }}"
become: true
register: features
Expand Down
4 changes: 2 additions & 2 deletions molecule/default-shell/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
2 changes: 1 addition & 1 deletion molecule/default-shell/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- name: Assert nushell is set as default shell of users
ansible.builtin.assert:
that: item.shell == "{{ nushell_binary_path }}/nu"
that: item.shell == "/usr/local/bin/nu"
quiet: true
loop: "{{ user_stats.results }}"
loop_control:
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
11 changes: 0 additions & 11 deletions molecule/full/converge.yml

This file was deleted.

25 changes: 0 additions & 25 deletions molecule/full/molecule.yml

This file was deleted.

38 changes: 0 additions & 38 deletions molecule/full/verify.yml

This file was deleted.

2 changes: 1 addition & 1 deletion molecule/macos/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ platforms:
- name: instance
provisioner:
name: ansible
log: false
log: true
verifier:
name: ansible
4 changes: 2 additions & 2 deletions molecule/macos/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

- name: Assert nushell is set as default shell of users
ansible.builtin.assert:
that: item.shell == "{{ nushell_binary_path }}/nu"
that: item.shell == "/usr/local/bin/nu"
quiet: true
loop: "{{ user_stats.results }}"
loop_control:
Expand All @@ -36,7 +36,7 @@
- name: Assert nu was added to .zprofile
ansible.builtin.lineinfile:
path: "/home/{{ item }}/.zprofile"
line: "{{ nushell_binary_path }}/nu -l"
line: "/usr/local/bin/nu -l"
state: present
check_mode: true
register: profile
Expand Down
4 changes: 2 additions & 2 deletions molecule/no-configs/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
4 changes: 2 additions & 2 deletions molecule/no-plugins/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
2 changes: 1 addition & 1 deletion molecule/no-plugins/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- name: Get list of registered plugins
ansible.builtin.shell: # noqa command-instead-of-shell
cmd: "version|to json"
executable: "{{ nushell_binary_path }}/nu"
executable: "/usr/local/bin/nu"
become_user: "{{ item }}"
become: true
register: installed_plugins
Expand Down
4 changes: 2 additions & 2 deletions molecule/plugin-subset/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
2 changes: 1 addition & 1 deletion molecule/plugin-subset/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- name: Get list of registered plugins
ansible.builtin.shell: # noqa command-instead-of-shell
cmd: "version|get installed_plugins|split row ','|str trim|to json"
executable: "{{ nushell_binary_path }}/nu"
executable: "/usr/local/bin/nu"
become: true
become_user: "{{ item }}"
register: installed_plugins
Expand Down
4 changes: 2 additions & 2 deletions molecule/profile/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
2 changes: 1 addition & 1 deletion molecule/profile/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: Assert nu was added to .profile
ansible.builtin.lineinfile:
path: "/home/{{ item }}/.profile"
line: "{{ nushell_binary_path }}/nu -l"
line: "/usr/local/bin/nu -l"
state: present
check_mode: true
register: profile
Expand Down
4 changes: 2 additions & 2 deletions molecule/specific-version/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand All @@ -18,7 +18,7 @@ platforms:
cgroupns_mode: host
provisioner:
name: ansible
log: false
log: true
playbooks:
prepare: ../common/prepare.yml
verifier:
Expand Down
2 changes: 1 addition & 1 deletion molecule/specific-version/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- name: Get nushell version
ansible.builtin.shell: # noqa command-instead-of-shell
cmd: "version|get version"
executable: "{{ nushell_binary_path }}/nu"
executable: "/usr/local/bin/nu"
register: version_to_check
changed_when: false

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requests==2.31.0 # https://github.com/ansible-community/molecule-plugins/issues/256
ansible
yamllint
ansible-lint
Expand Down
2 changes: 1 addition & 1 deletion tasks/configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
ansible.builtin.lineinfile:
path: "{{ item.homedir }}/{{ nushell_config_path }}/env.nu"
regexp: "^.*PROMPT_INDICATOR.*$"
line: "{{ '$env.' if '0.83.0' is version(_nushell_version, '<=') else 'let-env ' }}PROMPT_INDICATOR = '({{ inventory_hostname }})〉'"
line: "{{ '$env.' if _nushell_version is version('0.83.0', '>=') else 'let-env ' }}PROMPT_INDICATOR = '({{ inventory_hostname }})〉'"
validate: "{{ nushell_binary_path }}/nu -n -c 'source %s; $env'"
when: add_hostname_to_prompt|bool
loop: "{{ home_dirs }}"
Expand Down
Loading

0 comments on commit 6dfaeee

Please sign in to comment.