hanxhx / ansible-debian-bootstrap Goto Github PK
View Code? Open in Web Editor NEWAnsible bootstrap role for Debian/Devuan/Ubuntu/Raspbian servers
License: GNU General Public License v2.0
Ansible bootstrap role for Debian/Devuan/Ubuntu/Raspbian servers
License: GNU General Public License v2.0
Add new feature for users. Add a password (with default omit).
Timeout (2 min) for reboot... it crashes the playbook.
N: Repository 'Debian bookworm' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split
Looks like you added support for Raspian
in master branch but there are no relase on galaxy.
BTW great job
I'm running this on my Raspberry Pi 4 (Raspbian), but when changing the hostname, I end up with this sequence:
changed: [raspberrypi]
_____________________________________________________
/ TASK [ansible-debian-bootstrap : TEMPLATE | Cleanup \
\ /etc/hosts] /
-----------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
fatal: [raspberrypi]: FAILED! => {"msg": "Timeout (12s) waiting for privilege escalation prompt: "}
_____________________________________________________
/ RUNNING HANDLER [ansible-debian-bootstrap : restart \
\ rsyslog] /
-----------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Changing the timeout to something higher does work, but I feel like it's not the proper solution.
This probably has to do with the fact that I'm using sudo and become: true
, but I would like to bootstrap with this configuration, since it's the default pi image configuration.
Any ideas of how to properly solve this?
It seems like after the first time that the hostname is changed, this is no longer an issue, for some reason. There's probably some tuning configuration that affects this?
instead of this dirty hack when rebooting
https://docs.ansible.com/ansible/latest/modules/wait_for_connection_module.html
Add a default variable to let users set other hosts.
Currently, I am using the below code.
- name: Add hostname to /etc/hosts
become: true
lineinfile:
dest: /etc/hosts
regexp: "127[.]0[.]0[.]1.*"
line: "127.0.0.1 localhost.localdomain localhost {{ ansible_hostname }} # added by ansible"
state: present
backup: yes
- name: Add Ansible inventory mappings to /etc/hosts
become: true
blockinfile:
path: /etc/hosts
block: |
{% for host in groups['all'] %}
{{ hostvars[host].ansible_host }} {{ host }}
{% endfor %}
I am thinking of switching over to this role and would be great if this part can be handled in this role itself.
FYI, I understand that you guys use 127.0.1.1 for hostname. I'm fine with that approach too. Just need space for peer hosts.
See: https://wiki.debian.org/LTS
Refactoring:
dbs_microcode_apt_distribution
glances
and jq
in dbs_packages
Add a special playbook file without:
From: June 30, 2020
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your
playbooks so that the environment value uses the full variable syntax
('{{dbs_packages}}'). This feature will be removed in a future release.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your
playbooks so that the environment value uses the full variable syntax
('{{dbs_distro_packages}}'). This feature will be removed in a future release.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your
playbooks so that the environment value uses the full variable syntax
('{{dbs_packages}}'). This feature will be removed in a future release.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your
playbooks so that the environment value uses the full variable syntax
('{{dbs_distro_packages}}'). This feature will be removed in a future release.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your
playbooks so that the environment value uses the full variable syntax
('{{dbs_sysctl_config}}'). This feature will be removed in a future release.
Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
fatal: [debian-jessie]: FAILED! => {"failed": true, "msg": "could not find 'ssh_keys' key in iterated item...
Latest Raspian is not supported
Missing file : vars/Raspbian/bullseye.yml
netcat-openbsd ❤️
This looks interesting but as someone who has minimal ansible knowledge I have no clue how to use it to set up a bunch of RaPi's to have hostnames, etc. Please consider adding more extensive examples to help ease into it from lower knowledge starting point. THx!
This commit overrides the bug: 9a63b27
I can manage systemd (default init) and sysvinit. It should be interesting to integrate OpenRC.
Note: Be careful with DHCP...
LTS version on active version
Hello, a used feature will be removed soon:
TASK [HanXHX.debian_bootstrap : APT | Install few packages] **********************************
[DEPRECATION WARNING]: "listify_lookup_plugin_terms" does not use "dataloader" anymore, the
ability to pass it in will be removed in future versions. This feature will be removed in
version 2.18.
update_password
optionI worked a little bit with https://github.com/rhietala/raspberry-ansible
where there is a copy of https://github.com/HanXHX/ansible-debian-bootstrap
I have played with an updated version for Stretch merged from here into https://github.com/keryell/raspberry-ansible/tree/stretch as tracked by rhietala/raspberry-ansible#3
As you said in rhietala/raspberry-ansible#2 it would be nice that https://github.com/HanXHX/ansible-debian-bootstrap were just usable for Raspberry Pi.
From what I understand the only main issue is that for Debian vars/debian.yml
has hardcoded debian
name in it while it is raspbian
for Raspbian.
So instead of having a new vars/raspbian.yml
with the name raspbian
in it, it could be a common file using a new variable to specify the detail of the distribution names in the URL.
Probably the Devuan option could be factorized out this way too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.