From 0aa2c8abf3f619b27acab705c30c42818ad0232d Mon Sep 17 00:00:00 2001 From: Dave Slotter Date: Sun, 15 May 2022 23:34:56 -0400 Subject: [PATCH] Revert hampi to pi (for now) --- hosts | 11 +++++---- tasks/configuration_tasks.yml | 44 +++++++++++++++++++++++++++++------ tasks/install_about.yml | 32 ++++++++++++------------- 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/hosts b/hosts index 939591d..a1ba531 100644 --- a/hosts +++ b/hosts @@ -4,7 +4,7 @@ [all] #127.0.0.1 -hampi.lan +hampi [nuc] #nuc.lan @@ -17,9 +17,12 @@ hampi.lan [all:vars] ansible_port=22 -ansible_user=hampi -ansible_password=hampi -ansible_sudo_pass=hampi +ansible_user=pi +ansible_password=raspberry +ansible_become_pass=raspberry +#ansible_user=hampi +#ansible_password=hampi +#ansible_sudo_pass=hampi ansible_python_interpreter=/usr/bin/python3 [nuc:vars] diff --git a/tasks/configuration_tasks.yml b/tasks/configuration_tasks.yml index 0750401..73f226e 100644 --- a/tasks/configuration_tasks.yml +++ b/tasks/configuration_tasks.yml @@ -22,27 +22,57 @@ block: | {{ ham_user }} ALL=(ALL) NOPASSWD: ALL - - name: Change hostname to {{ ham_user }} (for current session) + - name: Change hostname to hampi (for current session) become: yes - command: hostname -b {{ ham_user }} + command: hostname -b hampi + when: is_rpi|bool - - name: Change hostname to {{ ham_user }} (permanently) + - name: Change hostname to hampc (for current session) + become: yes + command: hostname -b hampc + when: is_pc|bool + + - name: Change hostname to hampi (permanently) become: yes copy: - src: "{{ playbook_dir }}/../files/etc/hostname_{{ ham_user }}" + src: "{{ playbook_dir }}/../files/etc/hostname_hampi" dest: "/etc/hostname" + when: is_rpi|bool + + - name: Change hostname to hampc (permanently) + become: yes + copy: + src: "{{ playbook_dir }}/../files/etc/hostname_hampc" + dest: "/etc/hostname" + when: is_pc|bool + + - name: Change hostname to hampi (for hosts file) + become: yes + copy: + src: "{{ playbook_dir }}/../files/etc/hosts_hampi" + dest: "/etc/hosts" + when: is_rpi|bool - - name: Change hostname to {{ ham_user }} (for hosts file) + - name: Change hostname to hampc (for hosts file) become: yes copy: - src: "{{ playbook_dir }}/../files/etc/hosts_{{ ham_user }}" + src: "{{ playbook_dir }}/../files/etc/hosts_hampc" dest: "/etc/hosts" + when: is_pc|bool - name: Store a basic version file in public location become: yes copy: - src: "{{ playbook_dir }}/../files/etc/{{ ham_user }}-release" + src: "{{ playbook_dir }}/../files/etc/hampi-release" dest: "/etc/{{ ham_user }}-release" + when: is_rpi|bool + + - name: Store a basic version file in public location + become: yes + copy: + src: "{{ playbook_dir }}/../files/etc/hampc-release" + dest: "/etc/hampc-release" + when: is_pc|bool - name: Check that the /boot/cmdline.txt exists stat: diff --git a/tasks/install_about.yml b/tasks/install_about.yml index 4496204..3c4ac9d 100644 --- a/tasks/install_about.yml +++ b/tasks/install_about.yml @@ -7,10 +7,10 @@ gather_facts: no tasks: - - name: Create /usr/share/icons/{{ ham_user }}/[RESOLUTION] directory + - name: Create /usr/share/icons/hampi/[RESOLUTION] directory become: yes file: - path: /usr/share/icons/{{ ham_user }}/{{ item }} + path: /usr/share/icons/hampi/{{ item }} state: directory mode: 644 with_items: @@ -23,15 +23,15 @@ - name: Create HamPi icon in /usr/share/icons become: yes copy: - src: "{{ playbook_dir }}/../files/usr/share/icons/{{ ham_user }}.png" - dest: "/usr/share/icons/{{ ham_user }}.png" + src: "{{ playbook_dir }}/../files/usr/share/icons/hampi.png" + dest: "/usr/share/icons/hampi.png" mode: 644 - - name: Create HamPi icon in /usr/share/icons/{{ ham_user }}/[RESOLUTION] + - name: Create HamPi icon in /usr/share/icons/hampi/[RESOLUTION] become: yes copy: - src: "{{ playbook_dir }}/../files/usr/share/icons/{{ ham_user }}/{{ ham_user }}.png" - dest: "/usr/share/icons/{{ ham_user }}/{{ item }}/{{ ham_user }}.png" + src: "{{ playbook_dir }}/../files/usr/share/icons/hampi/hampi.png" + dest: "/usr/share/icons/hampi/{{ item }}/hampi.png" mode: 644 with_items: - 256x256 @@ -40,10 +40,10 @@ - 48x48 - 32x32 - - name: Create /usr/share/pixmaps/{{ ham_user }}/[RESOLUTION] directory + - name: Create /usr/share/pixmaps/hampi/[RESOLUTION] directory become: yes file: - path: /usr/share/pixmaps/{{ ham_user }}/{{ item }} + path: /usr/share/pixmaps/hampi/{{ item }} state: directory mode: 644 with_items: @@ -56,15 +56,15 @@ - name: Create HamPi icon in /usr/share/pixmaps become: yes copy: - src: "{{ playbook_dir }}/../files/usr/share/pixmaps/{{ ham_user }}.png" - dest: "/usr/share/pixmaps/{{ ham_user }}.png" + src: "{{ playbook_dir }}/../files/usr/share/pixmaps/hampi.png" + dest: "/usr/share/pixmaps/hampi.png" mode: 644 - - name: Create HamPi icon in /usr/share/pixmaps/{{ ham_user }}/[RESOLUTION] + - name: Create HamPi icon in /usr/share/pixmaps/hampi/[RESOLUTION] become: yes copy: - src: "{{ playbook_dir }}/../files/usr/share/pixmaps/{{ ham_user }}/{{ ham_user }}.png" - dest: "/usr/share/pixmaps/{{ ham_user }}/{{ item }}/{{ ham_user }}.png" + src: "{{ playbook_dir }}/../files/usr/share/pixmaps/hampi/hampi.png" + dest: "/usr/share/pixmaps/hampi/{{ item }}/hampi.png" mode: 644 with_items: - 256x256 @@ -83,6 +83,6 @@ - name: Create HamPi script in /usr/bin become: yes copy: - src: "{{ playbook_dir }}/../files/usr/bin/about_{{ ham_user }}" - dest: "/usr/bin/about_{{ ham_user }}" + src: "{{ playbook_dir }}/../files/usr/bin/about_hampi" + dest: "/usr/bin/about_hampi" mode: 755