From f82ac33ae3d9a7f304573a8e8acd43ce1c284214 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 16:44:38 +0400 Subject: [PATCH 1/9] update --- defaults/main.yml | 3 ++- tasks/{ubuntu/localepurge.yml => deb/main.yml} | 12 ++++++------ tasks/main.yml | 4 ++-- tasks/ubuntu/main.yml | 6 ------ 4 files changed, 10 insertions(+), 15 deletions(-) rename tasks/{ubuntu/localepurge.yml => deb/main.yml} (78%) delete mode 100644 tasks/ubuntu/main.yml diff --git a/defaults/main.yml b/defaults/main.yml index 87ed0f6..717d889 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1 +1,2 @@ -locale: "C.UTF-8" +default_locale: "C.UTF-8" +locales: "en_US.UTF-8,ru_RU.UTF-8" diff --git a/tasks/ubuntu/localepurge.yml b/tasks/deb/main.yml similarity index 78% rename from tasks/ubuntu/localepurge.yml rename to tasks/deb/main.yml index 3097547..1f0cb53 100644 --- a/tasks/ubuntu/localepurge.yml +++ b/tasks/deb/main.yml @@ -1,10 +1,10 @@ --- -- name: Set default locale to {{ locale }} +- name: Set default locale to {{ default_locale }} debconf: name: locales question: locales/default_environment_locale - value: "{{ locale }}" + value: "{{ default_locale }}" vtype: select # @@ -13,14 +13,14 @@ debconf: name: localepurge question: localepurge/nopurge - value: "{{ locale }}" + value: "{{ locales }}" vtype: multiselect - name: Generate locales debconf: name: locales question: locales/locales_to_be_generated - value: "{{ locale }}" + value: "{{ locales }}" vtype: multiselect # @@ -58,5 +58,5 @@ # -- name: Force locale to {{ locale }} - shell: update-locale --reset LANG={{ locale }} LC_ALL={{ locale }} +- name: Force locale to {{ default_locale }} + shell: update-locale --reset LANG={{ default_locale }} LC_ALL={{ default_locale }} diff --git a/tasks/main.yml b/tasks/main.yml index 91e083e..d4e027e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,5 +3,5 @@ # Ubuntu - name: Perform specific setup for Ubuntu, Debian & Linux Mint include_tasks: ubuntu/main.yml - when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' or ansible_distribution == 'Linux Mint' - tags: ubuntu + when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' + tags: deb diff --git a/tasks/ubuntu/main.yml b/tasks/ubuntu/main.yml deleted file mode 100644 index 717d352..0000000 --- a/tasks/ubuntu/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -# localepurge -- name: Install & configure localepurge - include_tasks: localepurge.yml - tags: localepurge -- GitLab From 7002b90298d175485b797fdcc54dd712669714f4 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 16:49:01 +0400 Subject: [PATCH 2/9] rm unused --- .gitlab-ci.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77f883f..e69de29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,34 +0,0 @@ -# VARIABLES -variables: - DOCKER_BUILDKIT: 1 - DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://localhost:2375 - DOCKER_TLS_CERTDIR: "" - -########################################################################################################## - -## PIPELINE DEFINITION -stages: - - check - -########################################################################################################## - -### COMMON SECTION -.common: &common - variables: - GIT_DEPTH: 1 - ANSIBLE_FORCE_COLOR: "True" - before_script: - - chmod -R o-w ../ - -########################################################################################################## - -### TEST SECTION -test: - <<: *common - stage: check - image: registry.cyberbrain.pw/ansible/ansible - except: - - /^master$/ - script: - - find . -type d -exec ansible-lint --force-color -v -x '204' {} \; -- GitLab From 7acda8b727e3308437a5ce94cc6c5ccc34529860 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 16:50:48 +0400 Subject: [PATCH 3/9] update meta --- meta/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/main.yml b/meta/main.yml index a83a580..5c6ff60 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,4 +1,6 @@ galaxy_info: + role_name: localepurge + namespace: dmitriysafronov author: Dmitriy Safronov description: Localepurge configuration # company: your company (optional) -- GitLab From 8b36298ef20108c5c6d2f614765bb6ec8ebc1ee9 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 16:52:27 +0400 Subject: [PATCH 4/9] fix 1 --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index d4e027e..67dbb84 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,6 +2,6 @@ # Ubuntu - name: Perform specific setup for Ubuntu, Debian & Linux Mint - include_tasks: ubuntu/main.yml + ansible.builtin.include_tasks: deb/main.yml when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' tags: deb -- GitLab From b9d5cabe4851a89b23387fe281d5227be666bd4d Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 16:55:55 +0400 Subject: [PATCH 5/9] fix 2 --- meta/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 5c6ff60..1af100f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -19,7 +19,7 @@ galaxy_info: # - CC-BY-4.0 license: LGPL-2.0-or-later - min_ansible_version: 2.9 + min_ansible_version: "2.12" # If this a Container Enabled role, provide the minimum Ansible Container version. # min_ansible_container_version: @@ -68,4 +68,4 @@ dependencies: # List your role dependencies here, one per line. Be sure to remove the '[]' above, # if you add dependencies to this list. -allow_duplicates: no +allow_duplicates: false -- GitLab From 5d1d0f3623d928f53bf96ec400b002b4672a80be Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 17:01:12 +0400 Subject: [PATCH 6/9] fix 3 --- meta/main.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 1af100f..b42f1c8 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -44,15 +44,16 @@ galaxy_info: platforms: - name: Ubuntu versions: - - focal - - bionic - - name: Linux Mint - versions: - - ulyana - - tricia + - all - name: Debian versions: - - buster + - all + - name: Fedora + versions: + - all + - name: OracleLinux + versions: + - all galaxy_tags: [] # List tags for your role here, one per line. A tag is a keyword that describes -- GitLab From 766c618380510176e7d3a0d6ef8f12e72f7da661 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 17:05:08 +0400 Subject: [PATCH 7/9] fix 4 --- tasks/deb/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/deb/main.yml b/tasks/deb/main.yml index 1f0cb53..77d9ede 100644 --- a/tasks/deb/main.yml +++ b/tasks/deb/main.yml @@ -52,7 +52,7 @@ apt: dpkg_options: 'force-confnew' state: present - update_cache: yes + update_cache: true pkg: - localepurge -- GitLab From 5de05be116d042184be124974cde4450fc9c7952 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 17:08:00 +0400 Subject: [PATCH 8/9] fix 5 --- tasks/deb/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/deb/main.yml b/tasks/deb/main.yml index 77d9ede..e91cb41 100644 --- a/tasks/deb/main.yml +++ b/tasks/deb/main.yml @@ -1,7 +1,7 @@ --- - name: Set default locale to {{ default_locale }} - debconf: + ansible.builtin.debconf: name: locales question: locales/default_environment_locale value: "{{ default_locale }}" @@ -10,14 +10,14 @@ # - name: Set exception for localepurge to {{ locale }} - debconf: + ansible.builtin.debconf: name: localepurge question: localepurge/nopurge value: "{{ locales }}" vtype: multiselect - name: Generate locales - debconf: + ansible.builtin.debconf: name: locales question: locales/locales_to_be_generated value: "{{ locales }}" @@ -26,21 +26,21 @@ # - name: Localepurge use dpkg feature - debconf: + ansible.builtin.debconf: name: localepurge question: localepurge/use-dpkg-feature value: 'True' vtype: boolean - name: Localepurge don't bother new locales - debconf: + ansible.builtin.debconf: name: localepurge question: localepurge/dontbothernew value: 'True' vtype: boolean - name: Localepurge show freed space - debconf: + ansible.builtin.debconf: name: localepurge question: localepurge/showfreedspace value: 'False' @@ -49,7 +49,7 @@ # - name: Install packages - apt: + ansible.builtin.apt: dpkg_options: 'force-confnew' state: present update_cache: true @@ -59,4 +59,4 @@ # - name: Force locale to {{ default_locale }} - shell: update-locale --reset LANG={{ default_locale }} LC_ALL={{ default_locale }} + ansible.builtin.shell: update-locale --reset LANG={{ default_locale }} LC_ALL={{ default_locale }} -- GitLab From a0616d2d0a989b9d21c3a76ad19987205f2f9be3 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Wed, 12 Apr 2023 17:12:58 +0400 Subject: [PATCH 9/9] fix 6 --- tasks/deb/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/deb/main.yml b/tasks/deb/main.yml index e91cb41..189cba4 100644 --- a/tasks/deb/main.yml +++ b/tasks/deb/main.yml @@ -58,5 +58,12 @@ # -- name: Force locale to {{ default_locale }} - ansible.builtin.shell: update-locale --reset LANG={{ default_locale }} LC_ALL={{ default_locale }} +- name: Template a file to /etc/default/locale + ansible.builtin.copy: + content: | + LANG={{ default_locale }} + LC_ALL={{ default_locale }} + dest: /etc/default/locale + owner: root + group: root + mode: "0644" -- GitLab