Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#486 motd #487

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelogs/fragments/motd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- "common: Exclude alias interfaces when templating motd.j2 (oravirt#486)"
- "common: force bool type in certain conditionals"
8 changes: 4 additions & 4 deletions roles/common/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Install EPEL Repo
when:
- configure_epel_repo
- configure_epel_repo | bool
tags:
- epelrepo
block:
Expand All @@ -22,7 +22,7 @@
path: /usr/bin/ol_yum_configure.sh
register: olyumconfigfile
when:
- configure_public_yum_repo
- configure_public_yum_repo | bool
- ansible_distribution == 'OracleLinux'
tags:
- olrepo
Expand All @@ -36,7 +36,7 @@
mode: 0644
when:
- not olyumconfigfile.stat.exists | default(false)
- configure_public_yum_repo
- configure_public_yum_repo | bool
- ansible_distribution == 'OracleLinux'
- ansible_distribution_major_version is version('7', '=')
tags:
Expand All @@ -47,7 +47,7 @@
name: "{{ common_packages }}"
state: installed
when:
- install_os_packages
- install_os_packages | bool
tags:
- commonpackages
notify: Reboot concerning package updates
2 changes: 1 addition & 1 deletion roles/common/tasks/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "{{ common_packages_sles }}"
state: installed
when:
- install_os_packages
- install_os_packages | bool
tags:
- commonpackages
notify: Reboot concerning package updates
4 changes: 2 additions & 2 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
name: "{{ ntp_type }}d"
state: started
enabled: true
when: configure_ntp
when: configure_ntp | bool

- name: Add motd
ansible.builtin.template:
src: "{{ motd_template }}"
dest: /etc/motd
mode: 0644
tags: motd
when: configure_motd
when: configure_motd | bool
2 changes: 1 addition & 1 deletion roles/common/templates/motd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Welcome to {{ ansible_hostname }}

FQDN: {{ ansible_fqdn }}
IP's:
{% for a in ansible_interfaces %}
{% if a != 'lo' and hostvars[inventory_hostname]['ansible_'~a]['ipv4']['address'] is defined %}
{% if a != 'lo' %}
{{a}}: {{ hostvars[inventory_hostname]['ansible_'~a]['ipv4']['address'] }}
{% endif %}
Expand Down
Loading