Skip to content

Commit

Permalink
Revert hampi to pi (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Slotter committed May 16, 2022
1 parent 1baad22 commit 0aa2c8a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 27 deletions.
11 changes: 7 additions & 4 deletions hosts
Expand Up @@ -4,7 +4,7 @@

[all]
#127.0.0.1
hampi.lan
hampi

[nuc]
#nuc.lan
Expand All @@ -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]
Expand Down
44 changes: 37 additions & 7 deletions tasks/configuration_tasks.yml
Expand Up @@ -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:
Expand Down
32 changes: 16 additions & 16 deletions tasks/install_about.yml
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 0aa2c8a

Please sign in to comment.