GithubHelp home page GithubHelp logo

hanxhx / ansible-debian-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
51.0 5.0 15.0 148 KB

Ansible bootstrap role for Debian/Devuan/Ubuntu/Raspbian servers

License: GNU General Public License v2.0

Shell 28.68% Jinja 69.99% Vim Script 1.33%
debian ansible-role ansible-roles ntp hostname systemd sysctl devuan ansible

ansible-debian-bootstrap's People

Contributors

hanxhx avatar robellegate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible-debian-bootstrap's Issues

Manage non-free-firmware repo for Debian 12+

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

Please release on Galaxy

Looks like you added support for Raspian in master branch but there are no relase on galaxy.

Expected

  • release a new version on Galaxy

BTW great job

How do I change the hostname without timing out?

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?

Add user defined hosts and IP addresses to /etc/hosts

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.

Add Travis CI

Add a special playbook file without:

  • setting hostname
  • disabling systemd
  • other?

Ansible 2.x Deprecations

[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.

Better instructions for nubes

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!

Deprecation: listify_lookup_plugin_terms does not use "dataloader" anymore

Hello, a used feature will be removed soon:

Deprecate ability of lookup plugins to return arbitrary data. Lookup plugins must return lists, failing to do so will be an error in 2.18.

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.

Support Raspbian for Raspberry Pi

I 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.ymlhas 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.