Make playbooks compatible with FreeBSD

This commit is contained in:
Anthony Rose 2019-10-10 19:45:35 +01:00
parent e5dac48410
commit 824d3178c0
4 changed files with 11 additions and 5 deletions

View file

@ -4,4 +4,5 @@
- include: freebsd.yml - include: freebsd.yml
when: ansible_distribution == 'FreeBSD' when: ansible_distribution == 'FreeBSD'
- include: modules.yml - include: modules.yml
when: ansible_system == 'Linux'
- include: ssh.yml - include: ssh.yml

View file

@ -8,13 +8,13 @@
register: changed_ssh_config register: changed_ssh_config
- name: Enable SSH - name: Enable SSH
become: true become: true
systemd: service:
name: ssh.service name: ssh
enabled: yes enabled: yes
state: started state: started
- name: Restart SSH - name: Restart SSH
become: true become: true
systemd: service:
name: ssh.service name: ssh
state: restarted state: restarted
when: changed_ssh_config.changed == true when: changed_ssh_config.changed == true

View file

@ -10,12 +10,14 @@
recurse: yes recurse: yes
depth: 3 depth: 3
register: emacs_service_files register: emacs_service_files
when: ansible_system == 'Linux'
- name: Create Emacs user service - name: Create Emacs user service
copy: copy:
src: '{{ item.path }}' src: '{{ item.path }}'
dest: "{{ ansible_env.HOME }}/.config/systemd/user/emacs.service" dest: "{{ ansible_env.HOME }}/.config/systemd/user/emacs.service"
remote_src: yes remote_src: yes
loop: '{{ emacs_service_files.files }}' loop: '{{ emacs_service_files.files }}'
when: ansible_system == 'Linux'
- name: Start Emacs user service - name: Start Emacs user service
systemd: systemd:
name: emacs.service name: emacs.service
@ -23,6 +25,7 @@
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes
state: started state: started
when: ansible_system == 'Linux'
- name: Create Emacs client launcher - name: Create Emacs client launcher
copy: copy:
src: "{{ ansible_env.HOME }}/.emacs.d/emacs-client.desktop" src: "{{ ansible_env.HOME }}/.emacs.d/emacs-client.desktop"

View file

@ -3,7 +3,9 @@
become: true become: true
copy: copy:
src: mate-acp.layout src: mate-acp.layout
dest: /usr/share/mate-panel/layouts/acp.layout dest: "{{ prefix }}/share/mate-panel/layouts/acp.layout"
vars:
prefix: "{{ '/usr/local' if ansible_distribution == 'FreeBSD' else '/usr' }}"
- name: Set default panel layout - name: Set default panel layout
dconf: dconf:
key: /org/mate/panel/general/default-layout key: /org/mate/panel/general/default-layout