Closed oomichi closed 2 years ago
Succeeded to create vms. Failed to run ansible-playbook command.
by adding --debug
option, we can see a lot of debug information like
$ vagrant up --debug
...
==> k8s-3: Please check https://docs.ansible.com/ansible/intro_inventory.html#hosts-and-groups
==> k8s-3: for more information.
INFO interface: detail: Running ansible-playbook...
INFO interface: detail: k8s-3: Running ansible-playbook...
k8s-3: Running ansible-playbook...
INFO subprocess: Starting process: ["/home/oomichi/kubespray-venv/bin/ansible-playbook", "--connection=ssh", "--timeout=30", "--limit=all,localhost", "--inventory-file=/home/oomichi/kubespray/.vagrant/provisioners/ansible/inventory", "--sudo", "--tags=facts", "--forks=3", "--flush-cache", "-e ansible_become_pass=vagrant", "cluster.yml"]
...
DEBUG subprocess: stderr: ansible-playbook: error: unrecognized arguments: --sudo
--sudo
option seems wrong on ansible-playbook command.
The command line looks like
$ ansible-playbook --connection=ssh --timeout=30 --limit=all,localhost \
--inventory-file=/home/oomichi/kubespray/.vagrant/provisioners/ansible/inventory \
--sudo --tags=facts --forks=3 --flush-cache -e ansible_become_pass=vagrant cluster.yml
After versioning up vagrant, different error happens
$ vagrant destroy
The provider 'libvirt' could not be found, but was requested to
back the machine 'k8s-1'. Please use a provider that exists.
Vagrant knows about the following providers: virtualbox, docker, hyperv
I needed to install libvirt plugin of vagrant with
$ vagrant plugin install libvirt
but that causes another conflict issue like
$ vagrant plugin install libvirt
Installing the 'libvirt' plugin. This can take a few minutes...
Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:
conflicting dependencies ffi (~> 0.6.3) and ffi (= 1.15.4)
Activated ffi-1.15.4
which does not match conflicting dependency (~> 0.6.3)
Conflicting dependency chains:
ffi (= 1.15.4), 1.15.4 activated
versus:
libvirt (> 0), 0.1.0 activated, depends on
ffi (~> 0.6.3)
vagrant-libvirt should be instead of libvirt. However an error still happens.
$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Vagrant failed to install the requested plugin because it depends
on a library which is not currently installed on this system. The
following library is required by the 'vagrant-libvirt' plugin:
libvirt
Please install the library and then run the command again.
After installing libvirt-dev package like
$ sudo apt install libvirt-dev
an error message is changed like
$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Vagrant failed to install the requested plugin because development tools
are required for installation but are not currently installed on this
machine. Please install development tools and then try this command
again.
The package build-essential can solve this issue.
$ sudo apt install libvirt-dev build-essential
Then try again
$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Fetching fog-libvirt-0.9.0.gem
Fetching vagrant-libvirt-0.7.0.gem
Installed the plugin 'vagrant-libvirt (0.7.0)'!
Succeeded to install vagrant-libvirt and run vagrant command
$ vagrant destroy
k8s-3: Are you sure you want to destroy the 'k8s-3' VM? [y/N] y
==> k8s-3: Removing domain...
==> k8s-3: Deleting the machine folder
k8s-2: Are you sure you want to destroy the 'k8s-2' VM? [y/N] y
==> k8s-2: Removing domain...
==> k8s-2: Deleting the machine folder
k8s-1: Are you sure you want to destroy the 'k8s-1' VM? [y/N] y
==> k8s-1: Removing domain...
==> k8s-1: Deleting the machine folder
Succeed to run Kubespray from vagrant up
!
Summary:
vagrant plugin install vagrant-libvirt
Error message: