added correct Readme + sample defaults
This commit is contained in:
parent
78199bc980
commit
68c199bee9
61
README.md
61
README.md
@ -1,8 +1,8 @@
|
|||||||
Manage repositories
|
Update MOTD
|
||||||
=========
|
=========
|
||||||
> This repository is only a mirror. Development and testing is done on a private gitlab server.
|
> This repository is only a mirror. Development and testing is done on a private gitlab server.
|
||||||
|
|
||||||
This role enables you to manage repositories on **debian-based** distributions. It can be used on its own , or be called by other roles the configure repositories on demand.
|
This role enables you to set a cool motd on **debian-based** distributions using neofetch.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
@ -11,42 +11,27 @@ None.
|
|||||||
|
|
||||||
Role Variables
|
Role Variables
|
||||||
--------------
|
--------------
|
||||||
Available variables are listed below, along with default values. A sample file for the default values is available in `default/manage_repositories.yml.sample` in case you need it for any `group_vars` or `host_vars` configuration.
|
Available variables are listed below, along with default values. A sample file for the default values is available in `default/update_motd.yml.sample` in case you need it for any `group_vars` or `host_vars` configuration.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
manage_repositories_enable_default_repo: true # by default, set to true
|
update_motd_filename: "00-motd-neofetch"
|
||||||
```
|
```
|
||||||
This variable enable or disable the configuration of the main distribution repositories (useful when calling this role to configure repo for another role like installing docker).
|
This variable sets the name for the file that'll be created in `/etc/update-motd.d` on the target system.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
manage_repositories_enable_custom_repo: false # by default, set to false
|
update_motd_print_info:
|
||||||
|
- name: "CPU"
|
||||||
|
module: "cpu"
|
||||||
```
|
```
|
||||||
This variable enable of disable the configuration of custom repositories
|
This variable is the list of modules that you want to enable in your motd. It references the neofetch modules. The `name` is the title that'll be appended to each module.
|
||||||
|
|
||||||
```yaml
|
All of the other variables are used for the configuration file of neofetch that'll sit in `/etc/profile.d/motd/cfg` by default.
|
||||||
manage_repositories_main_repo_uri: # by default, this variable has the following values
|
These are one to one identical to the neofetch modules. Documentation on the different settings can be found in the `files/documentation` file. It's just a copy on the default neofetch config file.
|
||||||
ubuntu: "http://fr.archive.ubuntu.com/ubuntu"
|
|
||||||
debian: "http://deb.debian.org/debian"
|
|
||||||
```
|
|
||||||
This variable sets the mirror URLs for the main repositories. You can optionally remove the distribution you don't want (ex. `remove manage_repositories_main_repo_uri[debian]` if you're only using ubuntu).
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
manage_repositories_custom_repo: # by default, this variable is not defined
|
|
||||||
- uri: "https://apt.releases.hashicorp.com"
|
|
||||||
gpg_key: "https://apt.releases.hashicorp.com/gpg"
|
|
||||||
comments: "hashicorp repository"
|
|
||||||
type: "deb"
|
|
||||||
suites: "{{ ansible_distribution_release }}"
|
|
||||||
components: "main"
|
|
||||||
filename: "hashicorp"
|
|
||||||
- uri: ...
|
|
||||||
```
|
|
||||||
This variable contains a list (1 to N) of custom repositories to install. IT HAS TO BE SET if `manage_repositories_enable_custom_repo == true`, or else the role might fail. Any unused field (like `gpg_key` in some instances) should be left blank (ex. `gpg_key:`). the role evaluates this against `None` to check if actions are needed.
|
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
------------
|
------------
|
||||||
|
|
||||||
None.
|
This role requires `ednxzu.manage_apt_packages` in order to make sur that neofetch is installed.
|
||||||
|
|
||||||
Example Playbook
|
Example Playbook
|
||||||
----------------
|
----------------
|
||||||
@ -56,27 +41,7 @@ Including an example of how to use your role (for instance, with variables passe
|
|||||||
# calling the role inside a playbook with either the default or group_vars/host_vars
|
# calling the role inside a playbook with either the default or group_vars/host_vars
|
||||||
- hosts: servers
|
- hosts: servers
|
||||||
roles:
|
roles:
|
||||||
- ednxzu.manage_repositories
|
- ednxzu.update_motd
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# calling the role inside a playbook and injecting variables (in another role for example)
|
|
||||||
- hosts: servers
|
|
||||||
tasks:
|
|
||||||
- name: "Configure hashicorp repository"
|
|
||||||
ansible.builtin.include_role:
|
|
||||||
name: ednxzu.manage_repositories
|
|
||||||
vars:
|
|
||||||
manage_repositories_enable_default_repo: false
|
|
||||||
manage_repositories_enable_custom_repo: true
|
|
||||||
manage_repositories_custom_repo:
|
|
||||||
- uri: "https://apt.releases.hashicorp.com"
|
|
||||||
gpg_key: "https://apt.releases.hashicorp.com/gpg"
|
|
||||||
comments: "hashicorp repository"
|
|
||||||
type: "deb"
|
|
||||||
suites: "{{ ansible_distribution_release }}"
|
|
||||||
components: "main"
|
|
||||||
filename: "hashicorp"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
License
|
License
|
||||||
|
78
defaults/update_motd.yml.sample
Normal file
78
defaults/update_motd.yml.sample
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
# update_motd_filename: "00-motd-neofetch"
|
||||||
|
# update_motd_print_info:
|
||||||
|
# - name: "CPU"
|
||||||
|
# module: "cpu"
|
||||||
|
# - name: "Memory"
|
||||||
|
# module: "memory"
|
||||||
|
# - name: "Local IP"
|
||||||
|
# module: local_ip
|
||||||
|
# - name: "Disk"
|
||||||
|
# module: "disk"
|
||||||
|
# update_motd_title_fqdn: "off"
|
||||||
|
# update_motd_kernel_shorthand: "on"
|
||||||
|
# update_motd_distro_shorthand: "off"
|
||||||
|
# update_motd_os_arch: "on"
|
||||||
|
# update_motd_uptime_shorthand: "on"
|
||||||
|
# update_motd_memory_percent: "off"
|
||||||
|
# update_motd_memory_unit: "mib"
|
||||||
|
# update_motd_package_managers: "on"
|
||||||
|
# update_motd_shell_path: "off"
|
||||||
|
# update_motd_shell_version: "on"
|
||||||
|
# update_motd_speed_type: "bios_limit"
|
||||||
|
# update_motd_speed_shorthand: "off"
|
||||||
|
# update_motd_cpu_brand: "on"
|
||||||
|
# update_motd_cpu_speed: "on"
|
||||||
|
# update_motd_cpu_cores: "logical"
|
||||||
|
# update_motd_cpu_temp: "off"
|
||||||
|
# update_motd_gpu_brand: "on"
|
||||||
|
# update_motd_gpu_type: "all"
|
||||||
|
# update_motd_refresh_rate: "off"
|
||||||
|
# update_motd_gtk_shorthand: "off"
|
||||||
|
# update_motd_gtk2: "on"
|
||||||
|
# update_motd_gtk3: "on"
|
||||||
|
# update_motd_public_ip_host: "http://ident.me"
|
||||||
|
# update_motd_public_ip_timeout: 2
|
||||||
|
# update_motd_local_ip_interface: ('auto')
|
||||||
|
# update_motd_de_version: "on"
|
||||||
|
# update_motd_disk_show: "('/')"
|
||||||
|
# update_motd_disk_subtitle: "mount"
|
||||||
|
# update_motd_disk_percent: "on"
|
||||||
|
# update_motd_music_player: "auto"
|
||||||
|
# update_motd_song_format: "%artist% - %album% - %title%"
|
||||||
|
# update_motd_song_shorthand: "off"
|
||||||
|
# update_motd_mpc_args: "()"
|
||||||
|
# update_motd_colors: "(distro)"
|
||||||
|
# update_motd_bold: "on"
|
||||||
|
# update_motd_underline_enabled: "on"
|
||||||
|
# update_motd_underline_char: "-"
|
||||||
|
# update_motd_separator: ":"
|
||||||
|
# update_motd_block_range: "(0 15)"
|
||||||
|
# update_motd_color_blocks: "on"
|
||||||
|
# update_motd_block_width: 3
|
||||||
|
# update_motd_block_height: 1
|
||||||
|
# update_motd_col_offset: "auto"
|
||||||
|
# update_motd_bar_char_elapsed: "-"
|
||||||
|
# update_motd_bar_char_total: "="
|
||||||
|
# update_motd_bar_border: "on"
|
||||||
|
# update_motd_bar_length: 15
|
||||||
|
# update_motd_bar_color_elapsed: "distro"
|
||||||
|
# update_motd_bar_color_total: "distro"
|
||||||
|
# update_motd_memory_display: "off"
|
||||||
|
# update_motd_battery_display: "off"
|
||||||
|
# update_motd_disk_display: "off"
|
||||||
|
# update_motd_image_backend: "ascii"
|
||||||
|
# update_motd_image_source: "auto"
|
||||||
|
# update_motd_ascii_distro: "auto"
|
||||||
|
# update_motd_ascii_colors: "(distro)"
|
||||||
|
# update_motd_ascii_bold: "on"
|
||||||
|
# update_motd_image_loop: "off"
|
||||||
|
# update_motd_thumbnail_dir: "${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
|
||||||
|
# update_motd_crop_mode: "normal"
|
||||||
|
# update_motd_image_size: "auto"
|
||||||
|
# update_motd_catimg_size: "2"
|
||||||
|
# update_motd_gap: 3
|
||||||
|
# update_motd_yoffset: 0
|
||||||
|
# update_motd_xoffset: 0
|
||||||
|
# update_motd_background_color: ""
|
||||||
|
# update_motd_stdout: "off"
|
Loading…
Reference in New Issue
Block a user