Skip to content

Commit

Permalink
ansible - add enabler for emmc flasher
Browse files Browse the repository at this point in the history
  • Loading branch information
orgua committed Aug 23, 2023
1 parent d850585 commit 1caa70a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
42 changes: 42 additions & 0 deletions deploy/setup_image_for_emmc_flashing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# Problem: fresh ubuntu-image just boots from sd-card, updating several sd-cards is a pain
# Solution: flash image on cards, boot in testbed
# NOTE: modify inventory to generic one:
# sheep:
# hosts:
# 192.168.165.[192:254]

- name: Activate eMMC-Flasher on fresh Ubuntu-Images (on SD-Card, booted by BBone)
hosts: all
become: true
gather_facts: false

vars:
default_user: ubuntu
default_password: temppwd

pre_tasks:

- name: Switch ansible-config to use default-credentials of distribution
ansible.builtin.set_fact:
# special internal variables:
ansible_user: "{{ default_user }}"
ansible_password: "{{ default_password }}"
ansible_become_password: "{{ default_password }}"

tasks:

- name: Send MAC as unique ID
ansible.builtin.lineinfile:
dest: '/boot/uEnv.txt'
regexp: "#?cmdline=init=/usr/sbin/init-beagle-flasher.*$"
line: "cmdline=init=/usr/sbin/init-beagle-flasher"
state: present

post_tasks:

- name: Restart device
ansible.builtin.reboot:
connect_timeout: 20
reboot_timeout: 100
failed_when: false
9 changes: 2 additions & 7 deletions deploy/setup_nw_lease_ip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,9 @@
- name: Configure a Lease for a specific IP
ansible.builtin.lineinfile:
dest: '/etc/dhcp/dhclient.conf'
regexp: "{{ item.regexpress }}"
line: "{{ item.replacement }}"
regexp: "^lease {.*$"
line: "lease {interface 'eth0'; fixed-address {{ host_ip }};}"
state: present
loop:
- {
regexpress: "^lease {.*$",
replacement: "lease {interface 'eth0'; fixed-address {{ host_ip }};}"
}

- name: Return current lease
ansible.builtin.shell:
Expand Down

0 comments on commit 1caa70a

Please sign in to comment.