Make playbook work on WSL again
This commit is contained in:
parent
caa81304ae
commit
8ebb6b96d5
3 changed files with 20 additions and 4 deletions
18
main.yml
18
main.yml
|
@ -14,9 +14,21 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Check for /run/ostree-booted
|
||||
stat: path=/run/ostree-booted
|
||||
register: ostree
|
||||
- name: Check if an ostree OS (e.g. Silverblue)
|
||||
ansible.builtin.stat:
|
||||
path: /run/ostree-booted
|
||||
register: check_ostree
|
||||
- name: Check for WSL
|
||||
ansible.builtin.command:
|
||||
cmd: 'grep microsoft /proc/version'
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
register: check_wsl
|
||||
|
||||
- name: Register useful variables
|
||||
ansible.builtin.set_fact:
|
||||
ostree: check_ostree.exists
|
||||
wsl: not check_wsl.failed
|
||||
|
||||
- include_role:
|
||||
name: arch
|
||||
|
|
|
@ -20,10 +20,13 @@
|
|||
- import_tasks: modules.yml
|
||||
- import_tasks: ssh.yml
|
||||
- import_tasks: solokeys.yml
|
||||
when: wsl == false
|
||||
- import_tasks: sudo.yml
|
||||
when: gui == true
|
||||
- import_tasks: packagekit.yml
|
||||
when: gui == true
|
||||
- import_tasks: timezone.yml
|
||||
when: wsl == false
|
||||
- import_tasks: systemd.yml
|
||||
when: wsl == false
|
||||
- import_tasks: gdm.yml
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
name: ssh.service
|
||||
enabled: yes
|
||||
state: started
|
||||
when: wsl == false
|
||||
- name: Restart SSH
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: ssh.service
|
||||
state: restarted
|
||||
when: changed_ssh_config.changed == true
|
||||
when: changed_ssh_config.changed == true and wsl == false
|
||||
|
|
Loading…
Reference in a new issue