Getting started with Ansible 13 – Adding Users & Bootstrapping

    5
    21



    Ansible is an incredible configuration management and provisioning utility that enables you to automate all the things. In this series, you’ll learn everything you need to know in order to use Ansible for your day-to-day administration duties. In video 13, we’ll look at adding a user, and then we’ll set up Ansible to use a specific user for running tasks. Also, we’ll walk through creating a bootstrap playbook specifically for adding new nodes.

    Full series:
    Part 1 (Introduction): https://linux.video/ansible1
    Part 2 (SSH Overview & Setup): https://linux.video/ansible2
    Part 3 (Setting up the Git Repository): https://linux.video/ansible3
    Part 4 (Running Commands): https://linux.video/ansible4
    Part 5 (Running Elevated Commands): https://linux.video/ansible5
    Part 6 (Writing our First Playbook): https://linux.video/ansible6
    Part 7 (The ‘when’ Conditional): https://linux.video/ansible7
    Part 8 (Improving your Playbook): https://linux.video/ansible8
    Part 9 (Targeting Specific Nodes): https://linux.video/ansible9
    Part 10 (Tags): https://linux.video/ansible10
    Part 11 (Managing Files): https://linux.video/ansible11
    Part 12 (Managing Services): https://linux.video/ansible12
    Part 13 (Adding Users): This video
    Part 14 (Roles): https://linux.video/ansible14
    Part 15 (Host Variables): https://linux.video/ansible15
    Part 16 (Templates): https://linux.video/ansible16

    ☁️ Get $100 in credit toward deploying your very own Linux servers on Linode!
    ➡️ http://linode.com/learnlinuxtv

    🙌 Support me on Patreon and get early access to new content!
    ➡️ https://learnlinux.link/patron

    Wiki article for this video:

    Getting Started with Ansible 13 – Managing Users

    🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
    ➡️ https://learnlinux.link/amazon

    💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
    ➡️ https://learnlinux.link/tinypilot

    💻 Check out Shells.com and spin up your very own Linux or Windows desktop in the cloud (commission earned):
    ➡️ https://learnlinux.link/shells

    🐦 Follow me on Twitter!
    ➡️ https://learnlinux.link/twitter

    💬 Official LearnLinux.tv Community:
    ➡️ https://community.learnlinux.tv

    📖 Check out jay’s latest book, Mastering Ubuntu Server 3rd Edition. Available now!
    ➡️ https://ubuntuserverbook.com

    👨 More about me:
    ➡️ https://www.jaylacroix.com
    ➡️ https://www.learnlinux.tv/about-me

    💽 How to create a bootable flash drive for installing Linux:
    ➡️ https://linux.video/flash-usb

    🐧 Which distro do I use?
    ➡️ https://learnlinux.link/mydistro

    🔐 How to better secure OpenSSH:
    ➡️ https://linux.video/secure-ssh

    ☁️ How to create a cloud Linux server with Linode:
    ➡️ https://learnlinux.link/create-linode

    #DevOps #Automation #Ansible

    source

    Previous articleFormation Gratuite Complète Docker pour DevOps + Labs – micro-services
    Next articleHow To Write Unit Tests For Existing Python Code // Part 1 of 2

    21 COMMENTS

    1. on my Centos Stream 8 i was getting crazy with the following error:
      ERROR! couldn't resolve module/action 'authorized_key'. This often indicates a misspelling, missing collection, or incorrect module path.
      It turned out i was missing a collection.
      Fixed installing it:
      ansible-galaxy collection install ansible.posix

    2. very cool course thank you so very much. it was cool updating a couple of machines, but things started to stink when i had six. now i push one command and every server is done. what a time and pain saver! thank you again for taking the time to make this and all of your videos. you have taught me so much and i really appreciate it .

    3. Hi Jay, I have a question. When I build a Ubuntu VM or server I ofcourse create a linux user and I already pull down the SSH keys from github with the option in the installer. So I dont want to make an other user: simone for example but I want to use my already made user: user_example. Is this possible with the config you made?

    4. Thanks for great videos!

      I have ran into a issue with the bootstrap playbook: When in your case the ansible.cfg has "remote_user" set to simone, Ansible will try to use that user when the bootstrap playbook is executed. But in fact the servers default user, such as root, ubuntu or whatever should be used for the bootstrap.
      This can be solved by adding the argument "-u default_user_on_server" to the ansible-playbook command.

    5. No matter what I do I get the following error when running bootstrap.yml:

      " FAILED! => {"changed": false, "msg": "Unsupported parameters for (apt) module: update Supported parameters include: allow_unauthenticated, autoclean, autoremove, cache_valid_time, deb, default_release, dpkg_options, force, force_apt_get, install_recommends, only_upgrade, package, policy_rc_d, purge, state, update_cache, upgrade"}"

    6. Thank you very much for this fantastic and very good explained playlist about ansible! I got it up and running with little confusions (ubuntu 20.04.1 does not really work with ansible_distribution variable, but 18.04.5 does!), but it is now running for nearly 15 virtual server under Proxmox and i am very happy about it 🙂 Thanks for your efforts and keep on doing this great job!