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
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Check for /run/ostree-booted
|
- name: Check if an ostree OS (e.g. Silverblue)
|
||||||
stat: path=/run/ostree-booted
|
ansible.builtin.stat:
|
||||||
register: ostree
|
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:
|
- include_role:
|
||||||
name: arch
|
name: arch
|
||||||
|
|
|
@ -20,10 +20,13 @@
|
||||||
- import_tasks: modules.yml
|
- import_tasks: modules.yml
|
||||||
- import_tasks: ssh.yml
|
- import_tasks: ssh.yml
|
||||||
- import_tasks: solokeys.yml
|
- import_tasks: solokeys.yml
|
||||||
|
when: wsl == false
|
||||||
- import_tasks: sudo.yml
|
- import_tasks: sudo.yml
|
||||||
when: gui == true
|
when: gui == true
|
||||||
- import_tasks: packagekit.yml
|
- import_tasks: packagekit.yml
|
||||||
when: gui == true
|
when: gui == true
|
||||||
- import_tasks: timezone.yml
|
- import_tasks: timezone.yml
|
||||||
|
when: wsl == false
|
||||||
- import_tasks: systemd.yml
|
- import_tasks: systemd.yml
|
||||||
|
when: wsl == false
|
||||||
- import_tasks: gdm.yml
|
- import_tasks: gdm.yml
|
||||||
|
|
|
@ -26,9 +26,10 @@
|
||||||
name: ssh.service
|
name: ssh.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
|
when: wsl == false
|
||||||
- name: Restart SSH
|
- name: Restart SSH
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: ssh.service
|
name: ssh.service
|
||||||
state: restarted
|
state: restarted
|
||||||
when: changed_ssh_config.changed == true
|
when: changed_ssh_config.changed == true and wsl == false
|
||||||
|
|
Loading…
Reference in a new issue