Commit a872e88e authored by Mathias BOCQUET's avatar Mathias BOCQUET

Initial commit

parents
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
'locales'. Ansible role to configure locales.
Copyright © 2019 Mathias Bocquet (mbocquet@sekoya.org)
This file is part of 'locales' Ansible role.
This 'locales' Ansible role is free software: you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This 'locales' Ansible role is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
for more details.
You should have received a copy of the GNU Affero General Public License along
with this 'locales' Ansible role. If not, see <http://www.gnu.org/licenses/>.
This diff is collapsed.
# locales
Ansible role to configure locales.
## Requirements
None.
## Role Variables
See defaults/main.yml.
## Dependencies
None.
## Install this role as submodule in a git repository
`git submodule add https://github.com/mbocquet/locales.git roles/locales`
## Example Playbook
- hosts: servers
roles:
- locales
or
- hosts: servers
roles:
- { role: locales, locales_default: 'en_US.UTF-8' }
## License
GPLv3
## Author Information
http://www.sekoya.org
---
# defaults file for locales
# Below are examples. these vars should go in group or host vars inventories files.
# locales_to_be_generated. Sets the locales to generate.
# locales_to_be_generated:
# - 'en_US.UTF-8'
# - 'fr_FR.UTF-8'
# locales_default. Sets the default locale to use
# locales_default: 'en_US.UTF-8'
# locales_default: 'C'
...
---
# handlers file for locales
galaxy_info:
author: Mathias BOCQUET
description: Ansible role to configure locales
company: Sekoya.org
license: GPLv3
min_ansible_version: 2.4
platforms:
- name: Debian
versions:
- jessie
- stretch
- buster
galaxy_tags:
- locales
- sysadmin
dependencies: []
---
# tasks file for locales
# https://stackoverflow.com/questions/52421542/ansible-debconf-module-not-working-properly-to-set-default-locale
# So for now we use locale_gen module to generate locales and a template to replace the default locale in /etc/default/locale
- name: generate
locale_gen:
name: '{{ item }}'
state: present
loop: "{{ locales_to_be_generated }}"
when: locales_to_be_generated is defined
tags:
- locales
- gen
- name: default
template:
src: default.j2
dest: /etc/default/locale
when: locales_default is defined
tags:
- locales
- default
...
# {{ ansible_managed }}. role: locales, file: default.j2
LANG={{ locales_default }}
---
- hosts: localhost
remote_user: root
roles:
- locales
---
# vars file for locales
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment