Initial commit
This commit is contained in:
52
roles/ontic.fonts/tasks/configure.yml
Executable file
52
roles/ontic.fonts/tasks/configure.yml
Executable file
@ -0,0 +1,52 @@
|
||||
# Copyright (c) Ontic. (http://www.ontic.com.au). All rights reserved.
|
||||
# See the COPYING file bundled with this package for license details.
|
||||
|
||||
---
|
||||
|
||||
- name: 'Fonts | Configure shared font directories.'
|
||||
become: yes
|
||||
file:
|
||||
path: '/usr/local/share/fonts/{{ item.type }}/{{ item.dest | dirname }}'
|
||||
state: 'directory'
|
||||
group: 'root'
|
||||
owner: 'root'
|
||||
mode: '0755'
|
||||
with_items: '{{ fonts_shared }}'
|
||||
when: 'fonts_shared | default(None) != None'
|
||||
|
||||
- name: 'Fonts | Configure shared fonts.'
|
||||
become: yes
|
||||
copy:
|
||||
src: '{{ item.src }}'
|
||||
dest: '/usr/local/share/fonts/{{ item.type }}/{{ item.dest }}'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
register: 'fonts_shared_installed'
|
||||
notify: 'rebuild fonts cache'
|
||||
with_items: '{{ fonts_shared }}'
|
||||
when: 'fonts_shared | default(None) != None'
|
||||
|
||||
- name: 'Fonts | Configure user font directories.'
|
||||
become: yes
|
||||
file:
|
||||
path: '/home/{{ item.name }}/.fonts/{{ item.type }}/{{ item.dest | dirname }}'
|
||||
state: 'directory'
|
||||
owner: '{{ item.owner | default(item.name) }}'
|
||||
group: '{{ item.group | default(omit) }}'
|
||||
mode: '0755'
|
||||
with_items: '{{ fonts_user }}'
|
||||
when: 'fonts_user | default(None) != None'
|
||||
|
||||
- name: 'Fonts | Configure user fonts.'
|
||||
become: yes
|
||||
copy:
|
||||
src: '{{ item.src }}'
|
||||
dest: '/home/{{ item.name }}/.fonts/{{ item.type }}/{{ item.dest }}'
|
||||
owner: '{{ item.owner | default(item.name) }}'
|
||||
group: '{{ item.group | default(omit) }}'
|
||||
mode: '{{ item.mode | default(omit) }}'
|
||||
register: 'fonts_user_installed'
|
||||
notify: 'rebuild fonts cache'
|
||||
with_items: '{{ fonts_user }}'
|
||||
when: 'fonts_user | default(None) != None'
|
28
roles/ontic.fonts/tasks/main.yml
Executable file
28
roles/ontic.fonts/tasks/main.yml
Executable file
@ -0,0 +1,28 @@
|
||||
# Copyright (c) Ontic. (http://www.ontic.com.au). All rights reserved.
|
||||
# See the COPYING file bundled with this package for license details.
|
||||
|
||||
---
|
||||
|
||||
- name: 'Fonts | Include OS-specific variables.'
|
||||
include_vars: '{{ item }}'
|
||||
with_first_found:
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
tags:
|
||||
- 'fonts'
|
||||
- 'fonts-package'
|
||||
- 'fonts-configure'
|
||||
- 'package'
|
||||
- 'configure'
|
||||
|
||||
- import_tasks: 'package.yml'
|
||||
tags:
|
||||
- 'fonts'
|
||||
- 'fonts-package'
|
||||
- 'package'
|
||||
|
||||
- import_tasks: 'configure.yml'
|
||||
tags:
|
||||
- 'fonts'
|
||||
- 'fonts-configure'
|
||||
- 'configure'
|
78
roles/ontic.fonts/tasks/package.yml
Executable file
78
roles/ontic.fonts/tasks/package.yml
Executable file
@ -0,0 +1,78 @@
|
||||
# Copyright (c) Ontic. (http://www.ontic.com.au). All rights reserved.
|
||||
# See the COPYING file bundled with this package for license details.
|
||||
|
||||
---
|
||||
|
||||
- name: 'Fonts | Debian | Install HTTPS transport.'
|
||||
become: yes
|
||||
apt:
|
||||
name: 'apt-transport-https'
|
||||
state: 'latest'
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
- name: 'Fonts | Debian | Update repository list.'
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: '{{ item }}'
|
||||
state: 'present'
|
||||
update_cache: false
|
||||
register: 'fonts_multiverse_installed'
|
||||
notify: 'rebuild fonts cache'
|
||||
with_items: '{{ fonts_repositories }}'
|
||||
when: 'ansible_distribution == "Debian"'
|
||||
|
||||
- name: 'Fonts | Debian | Update APT cache.'
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: 'ansible_os_family == "Debian" and fonts_multiverse_installed.changed'
|
||||
|
||||
- name: 'Fonts | Debian | Install Microsoft Core Fonts prerequisites.'
|
||||
become: yes
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
state: 'present'
|
||||
with_items:
|
||||
- 'libfreetype6'
|
||||
- 'libfreetype6-dev'
|
||||
- 'fontconfig'
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
- name: 'Fonts | Debian | Accept Microsoft Core Fonts EULA.'
|
||||
become: yes
|
||||
debconf:
|
||||
name: 'ttf-mscorefonts-installer'
|
||||
question: 'msttcorefonts/accepted-mscorefonts-eula'
|
||||
value: 'true'
|
||||
vtype: 'select'
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
- name: 'Fonts | Debian | Install Microsoft Core Fonts.'
|
||||
become: yes
|
||||
apt:
|
||||
name: 'ttf-mscorefonts-installer'
|
||||
state: 'present'
|
||||
register: 'fonts_microsoft_installed'
|
||||
notify: 'rebuild fonts cache'
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
- name: 'Fonts | RedHat | Install Microsoft Core Fonts prerequisites.'
|
||||
become: yes
|
||||
yum:
|
||||
name: '{{ item }}'
|
||||
state: 'present'
|
||||
with_items:
|
||||
- 'curl'
|
||||
- 'cabextract'
|
||||
- 'xorg-x11-font-utils'
|
||||
- 'fontconfig'
|
||||
when: 'ansible_os_family == "RedHat"'
|
||||
|
||||
- name: 'Fonts | RedHat | Install Microsoft Core Fonts.'
|
||||
become: yes
|
||||
yum:
|
||||
name: 'https://raw.githubusercontent.com/therevoman/mscorefonts2-code/master/RPMS/noarch/msttcore-fonts-installer-2.6-1.noarch.rpm'
|
||||
state: 'present'
|
||||
validate_certs: no
|
||||
notify: 'rebuild fonts cache'
|
||||
when: 'ansible_os_family == "RedHat"'
|
Reference in New Issue
Block a user