Browse Source

Check if default shell is configured

master
Maxim Likhachev 6 years ago
parent
commit
aff75cfeca
  1. 23
      roles/macos/tasks/main.yml

23
roles/macos/tasks/main.yml

@ -19,14 +19,21 @@ @@ -19,14 +19,21 @@
name: "{{ apps_brew_cask }}"
ignore_errors: yes
- name: Add Bash to /etc/shells
become: true
lineinfile:
path: /etc/shells
line: /usr/local/bin/bash
- name: Set Bash as default shell
command: chsh -s /usr/local/bin/bash
- name: Get default shell
shell: dscl . -read ~/ UserShell | cut -d ' ' -f 2-
register: current_shell
- name: Configure {{ default_shell.name }} as a default shell
when: current_shell.stdout != default_shell.path
block:
- name: Add {{ default_shell.name }} to /etc/shells
become: true
lineinfile:
path: /etc/shells
line: "{{ default_shell.path }}"
- name: Set Bash as default shell
command: chsh -s {{ default_shell.path }}
- include: install-dmg.yml
become: true

Loading…
Cancel
Save