diff --git a/branding/defaults/main.yml b/branding/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..2628fb8391b6747fa363f9f199808bf346103263 --- /dev/null +++ b/branding/defaults/main.yml @@ -0,0 +1,4 @@ +--- + +branding_motd: motd.j2 +branding_issuenet: issue.net.j2 diff --git a/branding/handlers/main.yml b/branding/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..bb8554cbccf1cd4ec7094ca783a0e55e061dfe04 --- /dev/null +++ b/branding/handlers/main.yml @@ -0,0 +1,5 @@ +--- + +- name: update apt cache + apt: update_cache=yes + diff --git a/branding/tasks/main.yml b/branding/tasks/main.yml index cf9183a8aee130403b398e49c5d38d69ee92482c..5d445611929a4464d001b2f7572edca58119a3a8 100644 --- a/branding/tasks/main.yml +++ b/branding/tasks/main.yml @@ -1,25 +1,76 @@ --- -# file: roles/common/tasks/shell.yml +# file: supplemental/branding/tasks/main.yml -- name: ensure deployment of greeter - copy: src=fsmpi/motd dest=/etc/motd owner=root group=root mode=0644 +- name: ensure deployment of motd + template: + src: "{{ branding_motd }}" + dest: /etc/motd + owner: root + group: root + mode: 0644 + when: branding_motd tags: - - config + - branding - shell - - fsmpi - name: ensure deployment of issue.net - copy: src=fsmpi/issue.net dest=/etc/issue.net owner=root group=root mode=0644 + template: + src: "{{ branding_issuenet }}" + dest: /etc/issue.net + owner: root + group: root + mode: 0644 + when: branding_issuenet tags: - - config + - branding - shell - - fsmpi -- name: ensure deployment of a fancy gitconfig for root - copy: src=fsmpi/gitconfig dest=/root/.gitconfig owner=root group=root mode=0640 +- name: ensure deployment of gitconfig for root + template: + src: gitconfig.j2 + dest: /root/.gitconfig + owner: root + group: root + mode: 0640 tags: - - config + - branding - shell - root - - fsmpi + +- name: ensure deployment of CA certificates + copy: + src: "{{ item }}" + dest: "/etc/ssl/certs/{{ item }}" + owner: root + group: root + mode: 0644 + with_items: "{{ branding_cacerts }}" + when: branding_cacerts is defined + tags: + - branding + - tls + +- name: ensure deployment of apt repository keys + apt_key: + data: "{{ lookup('file', item) }}" + state: present + with_items: "{{ branding_apt_keys }}" + when: branding_apt_keys is defined + notify: + - update apt cache + tags: + - branding + - repos + +- name: ensure configuration of apt repositories + apt_repository: + repo: 'deb [arch=amd64] {{ item }}' + state: present + with_items: "{{ branding_apt_repos }}" + when: branding_apt_repos is defined + notify: + - update apt cache + tags: + - branding + - repos diff --git a/branding/files/fsmpi/gitconfig b/branding/templates/gitconfig.j2 similarity index 50% rename from branding/files/fsmpi/gitconfig rename to branding/templates/gitconfig.j2 index 64dc706795ca6828f93842c696a5f9a5e4fe8a0f..d3d4fc8722040a20003d55f78247854e0ee241ac 100644 --- a/branding/files/fsmpi/gitconfig +++ b/branding/templates/gitconfig.j2 @@ -1,6 +1,6 @@ [user] - name = FSMPI Admin-Team - email = admin@fsmpi.rwth-aachen.de + name = {{ branding_root_name }} + email = {{ branding_root_mail }} [push] default = simple [alias] diff --git a/branding/files/fsmpi/issue.net b/branding/templates/issue.net.j2 similarity index 51% rename from branding/files/fsmpi/issue.net rename to branding/templates/issue.net.j2 index 5cb7f36bf5d358a30a68787c892598f738fd0ce8..80568e1c3a758bc9b30c4a0a1190310ad2e8c264 100644 --- a/branding/files/fsmpi/issue.net +++ b/branding/templates/issue.net.j2 @@ -1,2 +1,2 @@ -Fachschaft Mathematik/Physik/Informatik, RWTH Aachen +{{ branding_organization }} Access to this machine is for authorized personnel only. diff --git a/branding/files/fsmpi/motd b/branding/templates/motd.j2 similarity index 61% rename from branding/files/fsmpi/motd rename to branding/templates/motd.j2 index 7632dafbfae894fa2a37ea25523fbc714d45063b..ec85696ea3f395bef39d530fe7f71fa62e61a9e8 100644 --- a/branding/files/fsmpi/motd +++ b/branding/templates/motd.j2 @@ -1,9 +1,9 @@ ######################################################################### -# RWTH Aachen University -- Fachschaft Mathematik/Physik/Informatik # +#{{ ' '*((71-branding_organization|length)/2)|round(0, 'floor')|int }}{{ branding_organization }}{{ ' '*((71-branding_organization|length)/2)|round(0, 'ceil')|int }}# ######################################################################### # # # If you have any problems send an eMail to # # # -# admin@fsmpi.rwth-aachen.de # +#{{ ' '*((71-branding_root_mail|length)/2)|round(0, 'floor')|int }}{{ branding_root_mail }}{{ ' '*((71-branding_root_mail|length)/2)|round(0, 'ceil')|int }}# # # #########################################################################