first commit
This commit is contained in:
28
solutions/issue.yml
Normal file
28
solutions/issue.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Automatically populate /etc/issue with environment name
|
||||
hosts:
|
||||
- dev
|
||||
- test
|
||||
- prod
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Determine environment name from inventory groups
|
||||
ansible.builtin.set_fact:
|
||||
env_name: >-
|
||||
{% if 'prod' in group_names %}
|
||||
Production
|
||||
{% elif 'test' in group_names %}
|
||||
Testing
|
||||
{% elif 'dev' in group_names %}
|
||||
Development
|
||||
{% endif %}
|
||||
|
||||
- name: Populate /etc/issue
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/issue
|
||||
content: |
|
||||
{{ env_name }}
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
Reference in New Issue
Block a user