diff options
author | heqnx <root@heqnx.com> | 2025-07-05 12:23:26 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-07-05 12:23:26 +0300 |
commit | e95318bcada0feb1dcdd44773e690b2addc6de38 (patch) | |
tree | 32cd9b106a5205c53cbe5d8fef3e1bc81d435660 | |
parent | 9457306a881cfe476ee0abbdba4f6f1eaa80db9d (diff) | |
download | ansible-icecast2-e95318bcada0feb1dcdd44773e690b2addc6de38.tar.gz ansible-icecast2-e95318bcada0feb1dcdd44773e690b2addc6de38.zip |
added random password
-rw-r--r-- | templates/icecast2/icecast.xml.j2 | 4 | ||||
-rw-r--r-- | templates/icecast2/ices-playlist.xml.j2 | 2 | ||||
-rw-r--r-- | vars/main.yaml | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/templates/icecast2/icecast.xml.j2 b/templates/icecast2/icecast.xml.j2 index 4c665b7..ae50250 100644 --- a/templates/icecast2/icecast.xml.j2 +++ b/templates/icecast2/icecast.xml.j2 @@ -14,10 +14,10 @@ </limits> <authentication> - <source-password></source-password> + <source-password>{{ random_password }}</source-password> <relay-password>disabled</relay-password> <admin-user>admin</admin-user> - <admin-password>password</admin-password> + <admin-password>{{ random_password }}</admin-password> </authentication> <hostname>localhost</hostname> diff --git a/templates/icecast2/ices-playlist.xml.j2 b/templates/icecast2/ices-playlist.xml.j2 index ae9a6be..89fc4c9 100644 --- a/templates/icecast2/ices-playlist.xml.j2 +++ b/templates/icecast2/ices-playlist.xml.j2 @@ -27,7 +27,7 @@ <instance> <hostname>localhost</hostname> <port>8000</port> - <password>password</password> + <password>{{ random_password }}</password> <mount>/stream</mount> <yp>0</yp> <reconnectdelay>60</reconnectdelay> diff --git a/vars/main.yaml b/vars/main.yaml index 66e7e27..9f8f32c 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -12,3 +12,4 @@ apt_packages: - vim fail2ban_jail_dir: /etc/fail2ban/jail.d +random_password: "{{ ((ansible_date_time.epoch | string) ~ inventory_hostname) | hash('sha1sum') | truncate(32, end='') }}" |