Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ups #57

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/os_agent_auto_update/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# defaults file for os_agent_auto_update
os_agent_auto_update_playbook_dir: /home/homeassistant/playbooks/
os_agent_ansible_playbook_cmd_dir: /root/.local/bin/
os_agent_ansible_playbook_cmd_dir: /usr/bin/
os_agent_auto_update_install_ansible: true
6 changes: 2 additions & 4 deletions roles/os_agent_auto_update/files/update_os_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
register: os_agent_latest_url
failed_when: os_agent_latest_url.stdout is not search('os-agent_.*_linux_.*.deb')
changed_when: false
check_mode: no
args:
warn: false
check_mode: false

- name: Install os-agent
apt:
deb: "{{ os_agent_latest_url.stdout|trim }}"
become: true
become: true
10 changes: 6 additions & 4 deletions roles/os_agent_auto_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
mode: 0700

- name: ensure ansible is installed
pip:
name: ansible<=2.10
extra_args: --user
executable: pip3
apt:
name:
- python3-ansible
state: present
update_cache: yes
become: true
when: os_agent_auto_update_install_ansible|bool

- name: schedule periodic update of OS Agent
Expand Down
16 changes: 12 additions & 4 deletions roles/supervised_install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ Install Home Assistant Supervised on Raspberry Pi 4 running Debian 11 (bullseye)
Requirements
------------

Python Packages:

- docker

OS Packages:

- python3-apt
- python3-docker
- debconf
- debconf-utils

Role Variables
--------------

Optional variables with example configurations

```yaml
# Used to create overrides for resolve.conf to fix DNS resolution
# If not set, then no resolve.conf overrides will be created
# ref: https://github.com/home-assistant/supervised-installer/issues/339
supervised_install_resolve_conf_overrides: |
DNS=192.168.68.1
DNSStubListener=no
```

Variables used from fact gathering

- ansible_pkg_mgr: Used to validate that apt is available, since it is used by this role to install OS packages
Expand Down
39 changes: 34 additions & 5 deletions roles/supervised_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@
- name: Install OS package prereqs # noqa 403
apt:
name:
- jq
- wget
- apparmor
- bluez
- cifs-utils
- curl
- udisks2
- dbus
- jq
- libglib2.0-bin
- lsb-release
- network-manager
- dbus
- apparmor-utils
- nfs-common
- systemd-journal-remote
- systemd-resolved
- udisks2
- wget
state: latest
update_cache: yes

Expand Down Expand Up @@ -54,6 +59,30 @@
regex: 'precedence ::ffff:0:0/96 100'
line: 'precedence ::ffff:0:0/96 100'

- name: Configure DNS resolution
block:
- name: Create resolve.conf drop in directory
ansible.builtin.file:
path: /etc/systemd/resolve.conf.d
state: directory
mode: 0755

- name: Create resolve.conf override config
ansible.builtin.copy:
content: |
[Resolve]
{{ supervised_install_resolve_conf_overrides }}
dest: /etc/systemd/resolve.conf.d/resolve.conf
mode: 0644
register: resolve_conf_override_result

- name: Restart systemd-resolved
ansible.builtin.service:
name: systemd-resolved
state: restarted
when: resolve_conf_override_result is changed
when: supervised_install_resolve_conf_overrides is defined

- name: Get download url for latest os-agent .deb release
shell: |
curl -s https://api.github.com/repos/home-assistant/os-agent/releases/latest \
Expand Down
11 changes: 6 additions & 5 deletions roles/supervised_install/tasks/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
- name: Install pip requirements for supervised_install
pip:
- name: Install python package requirements for supervised_install
apt:
name:
- docker
executable: pip3
extra_args: --user
- python3-docker
state: present
update_cache: yes
become: true

- name: Install OS package requirements for supervised_install # noqa 403
apt:
Expand Down
Loading