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

Failure when following the documented installation instructions. #738

Open
DLLarson opened this issue Dec 14, 2024 · 11 comments
Open

Failure when following the documented installation instructions. #738

DLLarson opened this issue Dec 14, 2024 · 11 comments
Labels

Comments

@DLLarson
Copy link
Contributor

I'm just following the instructions step-by-step found here:

https://ansible-nas.io/docs/getting-started/installation/

I used Ubuntu Server named ubuntu-22.04.5-live-server-amd64.iso to create a VMWare system on Windows 11. I'm using the latest VMWare workstation and Win 11. I installed build-essential and ansible packages supplied with the release.

I cloned the latest (12/14/2024) ansible-nas repo from GitHub (Commit 1aec019.) for step 1.

Did step 2 verbatim.

For step 3 I changed nas.yml to the following:

---
##                       ._____.   .__
##  _____    ____   _____|__\_ |__ |  |   ____             ____ _____    ______
##  \__  \  /    \ /  ___/  || __ \|  | _/ __ \   ______  /    \\__  \  /  ___/
##   / __ \|   |  \\___ \|  || \_\ \  |_\  ___/  /_____/ |   |  \/ __ \_\___ \
##  (____  /___|  /____  >__||___  /____/\___  >         |___|  (____  /____  >
##       \/     \/     \/        \/          \/               \/     \/     \/
##     a n s i b l e - n a s      https://github.com/davestephens/ansible-nas

# Add your all.yml config overrides to this file. See group_vars/all.yml for all possible settings.

# Example options
ansible_nas_hostname: testnas2
ansible_nas_timezone: Etc/UTC

## Enable some applications
homepage_enabled: true

For step 4 I changed the inventory file to this:

##                       ._____.   .__
##  _____    ____   _____|__\_ |__ |  |   ____             ____ _____    ______
##  \__  \  /    \ /  ___/  || __ \|  | _/ __ \   ______  /    \\__  \  /  ___/
##   / __ \|   |  \\___ \|  || \_\ \  |_\  ___/  /_____/ |   |  \/ __ \_\___ \
##  (____  /___|  /____  >__||___  /____/\___  >         |___|  (____  /____  >
##       \/     \/     \/        \/          \/               \/     \/     \/
##     a n s i b l e - n a s      https://github.com/davestephens/ansible-nas


[all]
## Example when running from a remote workstation
# ansible-nas ansible_host=192.168.1.30

## Example when running directly on your Ansible-NAS server
ansible-nas ansible_connection=local ansible_host=localhost

[nas]
ansible-nas

For step 5 I ran the requirements.yml install file verbatim. It had no errors.

Finally I ran the playbook running the exact command as supplied. I provided my sudo password to the process. This is what resulted:

skb@testnas2:~/ansible-nas$ ansible-playbook -i inventories/my-ansible-nas/inventory nas.yml -b -K
BECOME password:
[WARNING]: Collection vladgh.samba does not support Ansible version 2.10.8
[WARNING]: Collection community.general does not support Ansible version 2.10.8
[WARNING]: Collection community.docker does not support Ansible version 2.10.8

PLAY [Ansible-NAS] *****************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [ansible-nas]

TASK [ansible-nas-users : Create ansible-nas group] ********************************************************************************************************************************
changed: [ansible-nas]

TASK [ansible-nas-users : Create ansible-nas user] *********************************************************************************************************************************
changed: [ansible-nas]

TASK [vladgh.samba.server : Include OS specific variables] *************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Install Samba packages] ********************************************************************************************************************************
changed: [ansible-nas]

TASK [vladgh.samba.server : Install Samba VFS extensions packages] *****************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Register Samba version] ********************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Create Samba shares root directory] ********************************************************************************************************************
fatal: [ansible-nas]: FAILED! => {"msg": "The conditional check '(samba_shares is defined and samba_shares | length > 0) and ( samba_manage_directories is defined and samba_manage_directories )' failed. The error was: error while evaluating conditional ((samba_shares is defined and samba_shares | length > 0) and ( samba_manage_directories is defined and samba_manage_directories )): [{'name': 'downloads', 'comment': 'Stuff downloaded', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ downloads_root }}'}, {'name': 'movies', 'comment': 'Movies', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ movies_root }}'}, {'name': 'tv', 'comment': 'TV Episodes', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ tv_root }}'}, {'name': 'music', 'comment': 'Music', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ music_root }}'}, {'name': 'podcasts', 'comment': 'Podcasts', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ podcasts_root }}'}, {'name': 'dump', 'comment': 'File dump', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ samba_shares_root }}/dump'}, {'name': 'games', 'comment': 'Games', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ samba_shares_root }}/games'}, {'name': 'photos', 'comment': 'Pictures', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ photos_root }}'}, {'name': 'books', 'comment': 'Books', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ books_root }}'}, {'name': 'audiobooks', 'comment': 'Audiobooks', 'guest_ok': True, 'public': True, 'writable': True, 'browsable': True, 'path': '{{ audiobooks_root }}'}, {'name': 'comics', 'comment': 'Comics', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ comics_root }}'}, {'name': 'documents', 'comment': 'Documents', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ documents_root }}'}, {'name': 'code', 'comment': 'Code', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ code_root }}'}, {'name': 'recordings', 'comment': 'Recordings', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ recordings_root }}'}]: 'recordings_root' is undefined\n\nThe error appears to be in '/home/skb/.ansible/collections/ansible_collections/vladgh/samba/roles/server/tasks/main.yml': line 38, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create Samba shares root directory\n  ^ here\n"}

PLAY RECAP *************************************************************************************************************************************************************************
ansible-nas                : ok=7    changed=3    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

-Dale

@DLLarson DLLarson added the bug label Dec 14, 2024
@DLLarson
Copy link
Contributor Author

I've managed to get farther by removing the distro's ansible and installing the lastest version using this link:

https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html#installing-ansible-on-ubuntu

It would be very helpful to provide more explicit instructions to get the proper ansible for ansible-nas.

But unfortunately the process breaks further into the playbook:

skb@testnas2:~/ansible-nas$ ansible-playbook -i inventories/my-ansible-nas/inventory nas.yml -b -K
BECOME password:

PLAY [Ansible-NAS] *****************************************************************************************************************************************************************

TASK [ansible-nas-users : Create ansible-nas group] ********************************************************************************************************************************
ok: [ansible-nas]

TASK [ansible-nas-users : Create ansible-nas user] *********************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Include OS specific variables] *************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Install Samba packages] ********************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Install Samba VFS extensions packages] *****************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Register Samba version] ********************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Create Samba shares root directory] ********************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Create share directories] ******************************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Ensure webserver document root exists] *****************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Create link to shares in webserver document root] ******************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Samba configuration] ***********************************************************************************************************************************
changed: [ansible-nas]

TASK [vladgh.samba.server : Install global include file] ***************************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Install home include file] *****************************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Install share specific include files] ******************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Create username map file if needed] ********************************************************************************************************************
skipping: [ansible-nas]

TASK [vladgh.samba.server : Start SMB service] *************************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Start NMB service] *************************************************************************************************************************************
ok: [ansible-nas]

TASK [vladgh.samba.server : Create Samba users if they don't exist yet] ************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.nfs : Include OS-specific variables.] ****************************************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.nfs : Include overrides specific to Fedora.] *********************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.nfs : include_tasks] *********************************************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.nfs : include_tasks] *********************************************************************************************************************************************
included: /home/skb/.ansible/roles/geerlingguy.nfs/tasks/setup-Debian.yml for ansible-nas

TASK [geerlingguy.nfs : Ensure NFS utilities are installed.] ***********************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.nfs : Ensure directories to export exist] ************************************************************************************************************************
changed: [ansible-nas] => (item=/mnt/Volume3/public *(rw,sync,no_root_squash))

TASK [geerlingguy.nfs : Copy exports file.] ****************************************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.nfs : Ensure nfs is running.] ************************************************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : Load OS-specific vars.] *********************************************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : include_tasks] ******************************************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : include_tasks] ******************************************************************************************************************************************
included: /home/skb/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml for ansible-nas

TASK [geerlingguy.docker : Ensure old versions of Docker are not installed.] *******************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : Ensure dependencies are installed.] *********************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.docker : Ensure additional dependencies are installed (on Ubuntu < 20.04 and any other systems).] ****************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Ensure additional dependencies are installed (on Ubuntu >= 20.04).] *************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : Add Docker apt key.] ************************************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.docker : Ensure curl is present (on older systems without SNI).] *************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Add Docker apt key (alternative for older systems without SNI).] ****************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Add Docker repository.] *********************************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.docker : Install Docker packages.] *******************************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Install Docker packages (with downgrade option).] *******************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.docker : Install docker-compose plugin.] *************************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Install docker-compose-plugin (with downgrade option).] *************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : Ensure /etc/docker/ directory exists.] ******************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Configure Docker daemon options.] ***********************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Ensure Docker is started and enabled at boot.] **********************************************************************************************************
ok: [ansible-nas]

TASK [geerlingguy.docker : Ensure handlers are notified now to avoid firewall conflicts.] ******************************************************************************************

RUNNING HANDLER [vladgh.samba.server : Restart SMB service] ************************************************************************************************************************
changed: [ansible-nas]

RUNNING HANDLER [vladgh.samba.server : Restart NMB service] ************************************************************************************************************************
changed: [ansible-nas]

RUNNING HANDLER [geerlingguy.nfs : reload nfs] *************************************************************************************************************************************
changed: [ansible-nas]

RUNNING HANDLER [geerlingguy.docker : restart docker] ******************************************************************************************************************************
changed: [ansible-nas]

TASK [geerlingguy.docker : include_tasks] ******************************************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Get docker group info using getent.] ********************************************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : Check if there are any users to add to the docker group.] ***********************************************************************************************
skipping: [ansible-nas]

TASK [geerlingguy.docker : include_tasks] ******************************************************************************************************************************************
skipping: [ansible-nas]

TASK [ansible-nas-general : Set login banner] **************************************************************************************************************************************
changed: [ansible-nas]

TASK [ansible-nas-general : Update apt-cache] **************************************************************************************************************************************
ok: [ansible-nas]

TASK [ansible-nas-general : Upgrade all packages] **********************************************************************************************************************************
skipping: [ansible-nas]

TASK [ansible-nas-general : Install some packages] *********************************************************************************************************************************
changed: [ansible-nas]

TASK [ansible-nas-general : Set hostname to testnas2] ******************************************************************************************************************************
ok: [ansible-nas]

TASK [ansible-nas-general : Set timezone to Etc/UTC] *******************************************************************************************************************************
ok: [ansible-nas]

TASK [ansible-nas-general : Permission share directories] **************************************************************************************************************************
fatal: [ansible-nas]: FAILED! => {"msg": "[{'name': 'downloads', 'comment': 'Stuff downloaded', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ downloads_root }}'}, {'name': 'movies', 'comment': 'Movies', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ movies_root }}'}, {'name': 'tv', 'comment': 'TV Episodes', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ tv_root }}'}, {'name': 'music', 'comment': 'Music', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ music_root }}'}, {'name': 'podcasts', 'comment': 'Podcasts', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ podcasts_root }}'}, {'name': 'dump', 'comment': 'File dump', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ samba_shares_root }}/dump'}, {'name': 'games', 'comment': 'Games', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ samba_shares_root }}/games'}, {'name': 'photos', 'comment': 'Pictures', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ photos_root }}'}, {'name': 'books', 'comment': 'Books', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ books_root }}'}, {'name': 'audiobooks', 'comment': 'Audiobooks', 'guest_ok': True, 'public': True, 'writable': True, 'browsable': True, 'path': '{{ audiobooks_root }}'}, {'name': 'comics', 'comment': 'Comics', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ comics_root }}'}, {'name': 'documents', 'comment': 'Documents', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ documents_root }}'}, {'name': 'code', 'comment': 'Code', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ code_root }}'}, {'name': 'recordings', 'comment': 'Recordings', 'guest_ok': True, 'public': True, 'writable': True, 'browseable': True, 'path': '{{ recordings_root }}'}]: 'recordings_root' is undefined"}

PLAY RECAP *************************************************************************************************************************************************************************
ansible-nas                : ok=34   changed=14   unreachable=0    failed=1    skipped=24   rescued=0    ignored=0

-Dale

@DLLarson
Copy link
Contributor Author

Hi all,

A bit more clarification about why and what I'm doing. I've been running Ansible-NAS on some hardware for years. But I've always found the process of keeping in-sync with the main project error prone. So I tend to avoid it unless I really need something new that was added.

So now I've built new server hardware to swap with my old system that's been working for years. I've decided to start fresh to avoid running down various issues from trying to upgrade the current older NAS before switching to the new hardware.

I reasoned that the system should be able to install right from scratch with the current code and then adapt my existing setup from that using a top down approach.

But I'm getting these issues with clean installs.

What am I doing wrong?

-Dale

@DLLarson
Copy link
Contributor Author

DLLarson commented Dec 14, 2024

Ok... So I have the playbook finishing. I had to add recordings_root to the group_vars/all.yml file to satisfy the process. The recordings_root was defined about 6 months ago. I believe that all default playbook runs would have failed after this point.

This leads me to believe that no testing has occurred since then or people are just patching things when they break without sending the fixes back the repository.

# Where roms are stored
roms_root: "{{ samba_shares_root }}/roms"

# Where recordings are stored  <= ADDED THIS vvvv
recordings_root: "{{ samba_shares_root }}/recordings"

# The description that'll appear next to your Ansible-NAS box when browsing your network
samba_server_string: Ansible NAS

I've attached a patch for the fix.

0001-Add-missing-definition-for-recordings_root.patch

-Dale

@DLLarson
Copy link
Contributor Author

Does this project still have some legs or had it be abandoned?

I hope it's still alive as I've found it's a decent solution for those of us that who ditched FreeNAS.

-Dale

@DLLarson
Copy link
Contributor Author

The Heimdall role is broken because it's missing the code to create the heimdall user and group. I've attached a patch to fix it.

0002-Add-back-lost-code-that-creates-heimdall-user-and-gr.patch

-Dale

@davestephens
Copy link
Owner

davestephens commented Dec 16, 2024

Hey, good spot with recordings_root - I've fixed that, as well as the Heimdall missing user (I removed the user requirement rather than add it back in). Thanks for highlighting these.

Regarding Ansible - I'm not seeing the same issue as you. I just ran a fresh install of Ansible (following the Ansible docs to install Python then Ansible via pip, not using the system Ansible which is ancient) and everything seems fine. Where did the system Ansible you're referring to come from? Ubuntu Server doesn't come with it installed OOTB.

@DLLarson
Copy link
Contributor Author

Hi,

Thanks for the quick reply!

Where did the system Ansible you're referring to come from? Ubuntu Server doesn't come with it installed OOTB.

There was a version of ansible available in the repositories in the stock install of 22.04 but ansible-nas complained about it (from an earlier post in this PR):

[WARNING]: Collection vladgh.samba does not support Ansible version 2.10.8
[WARNING]: Collection community.general does not support Ansible version 2.10.8
[WARNING]: Collection community.docker does not support Ansible version 2.10.8

So I went and looked more closely at your instructions and followed the ansible site link. I looked at the pip stuff etc... and felt I wasn't a much of a python expert and found the following more direct approach (for me anyway) to install the latest version:

https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html#installing-ansible-on-ubuntu

This used a ppa supplied by the Ansible project. After installing ansible from it I checked the installed version:

skb@nas2:~$ ansible --version
ansible [core 2.17.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/skb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/skb/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Ansible-nas was happy with this newer installed version of ansible. After that I ran into the other issues that I patched over.

Truth be told...

My first attempt was to install Ansible-nas on the latest Ubuntu 24.02LTS. On that OS ansible-nas didn't complain about the ansible version supplied with the OS distro but I ran into a missing package it was trying to install from defaults/main.yml of the ansible-nas-general role (excerpt follows):

# Extra packages to install
ansible_nas_extra_packages:
  - smartmontools
  - htop
  - zfsutils-linux
  - bonnie++
  - unzip
  - lm-sensors
  - ctop      <= 24.04LTS doesn't seem provide this package anymore. 22.04LTS does.

So I scratched that approach without much more investigation and reinstalled the latest 22.04.x server version of Ubuntu since that's the one you recommend.

Anyway...

I'll pick up your latest commits and remove the patches I put into my custom ansible repository I use to drive the process. FWIW...You can see it here:

https://github.com/DLLarson/my-ansible-nas

I basically include ansible-nas as a git submodule to my repository so I can keep my stuff completely out of the ansible source code.

-Dale

@gteltschik
Copy link

In case it's helpful, here are my instructions/notes from my last ansible-nas install, based on the issues I encountered. Note that the zfsutils and net-utils are probably not required, but helpful if you are using zfs storage like I am. And yes, I am aware many of these commands could be consolidated.

  1. install Ubuntu 22.04
  2. sudo apt-get update
  3. sudo apt-get upgrade
  4. sudo apt install ubuntu-advantage-tools
  5. sudo apt install zfsutils
  6. sudo apt install net-utils
  7. sudo apt remove ansible
  8. sudo apt --purge autoremove
  9. sudo apt -y install software-properties-common
  10. sudo apt-add-repository ppa:ansible/ansible
  11. sudo apt install ansible
  12. git clone https://github.com/davestephens/ansible-nas.git && cd ansible-nas
  13. cp -rfp inventories/sample inventories/my-ansible-nas
  14. vi inventories/my-ansible-nas/inventory; uncomment ansible-nas ansible-connection=local ansible_host=localhost line;save
  15. vi inventories/my-ansible-nas/group-vars/nas.yml; edit hostname, timezone (America/Chicago), desired services
  16. sudo ansible-galaxy install -r requirements.yml
  17. sudo ansible-playbook -i inventories/my-ansible-nas/inventory nas.yml -b -K

@DLLarson
Copy link
Contributor Author

In case it's helpful, here are my instructions/notes from my last ansible-nas install, based on the issues I encountered.

That's very close to the steps I took as I bumped into problems. These steps avoid confusion of putzing with python PIP, etc. There is a link to the ansible site given below that would replace steps 7-11.

https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html#installing-ansible-on-ubuntu

-Dale

@DLLarson
Copy link
Contributor Author

DLLarson commented Dec 20, 2024

I'll note that my new Ansible-NAS machine is fully up and running with the same configuration (living on top of the latest ansible-nas commits) as my 10 year old NAS server (that started on FreeNAS and sometime later I ditched it for Ansible-NAS and never looked back.) The old machine is just sitting around until I have more confidence with the new hardware.

Another great benefit of stepping up my hardware is access to 2.5Gb ethernet connections! Blazing fast compared to my old foggy ITX 16GB RAM 4 core AMD machine running WD Red Drives with a USB drive for the OS with 1Gb ethernet.

My new machine runs an ATX MB that supports up to 5 NVMe SSD drives directly on the MB. My processor jumped from 4 cores to a current i7 with 20 cores--8p+12e--(28 threads). One NVMe SSD drive is 1TB and used for the OS. The remaining four are 4TB each and setup for raidz2. It's a beast. Of course I also had to buy some 2.5Gb ethernet switches but it was worth it.

-Dale

@gteltschik
Copy link

That's very close to the steps I took as I bumped into problems. These steps avoid confusion of putzing with python PIP, etc. There is a link to the ansible site given below that would replace steps 7-11.

https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html#installing-ansible-on-ubuntu

-Dale

There are many ways to skin a cat, as they say. This was my list I cobbled together as I worked through the various issues I had building a new server (I now have 5 Ansible-NAS servers running for various reasons - they make great general purpose platforms with a lot of common services easily configured). From what I recall:

  • ubuntu-advantage-tools adds one of the commands one of the later scripts will be using
  • zfs-utils and net-utils add in some of the common zfs pool and ifconfig type commands you will likely be doing
    • the purge autoremove after uninstalling the distribution ansible package does some clean up that makes the ppa install go smooth
  • software-properties-common is required for ppa/ansible

You'll also want to do any share drive/storage array config before you complete your yml config and run the playbook.

I'm a recovered FreeNAS user as well. The second time an upgrade bricked my NAS and I had to spend hours figuring out what they did to break it, I started looking for something else. The third upgrade was going to stop supporting my hardware. Ansible-NAS doesn't have the fancy GUI, but if you can install Ubuntu, you can make it a server.

If you do decide to try a refresh/rebuild - which I used to avoid as well - I recommend you write a script so you don't have to remember it from scratch. Mine is a work in progress, but right now I am using this:

#!/usr/bin/env bash
git stash
git pull https://github.com/davestephens/ansible-nas
sudo git pull https://github.com/davestephens/ansible-nas
grep enabled ansible-nas/inventories/my-ansible-nas/group_vars/nas.yml | grep true | awk -F_ '{print $1 }' > active-services.list
for container in [cat active-services.list]
do
sudo docker stop $container
done
sudo ansible-playbook -i inventories/my-ansible-nas/inventory nas.yml -b -K

Again, don't remember the details, but I think I found it worked best to stop everything as some of the services would complain in the playbook run. Since I have some non-scripted docker containers running as well, that script is trying to only kill the relevant ones that will be impacted by the playbook. It still needs modification for the stats package and such.

If you run into problems, I found that re-running the requirements.yml command from the initial install will usually sort it out, but most of the time it's not needed - really only if you keep putting it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants