0 votes
1 view
in Devops and Agile by (2.3k points)

So, i have been working on ansible tool.

This is what my task looks like:

- name: Create a started container

    lxc_container:

      name: test-container-started

      container_log: true

      template: ubuntu

      state: started

      template_options: --release trusty

this is the error i am getting:

> TASK: [lxc | Create a started container]

> **************************************  failed: [localhost] => {"failed": true, "parsed": false}

> BECOME-SUCCESS-azsyqtknxvlowmknianyqnmdhuggnanw failed=True msg='The

> lxc module is not importable. Check the requirements.' The lxc module

> is not importable. Check the requirements.

> FATAL: all hosts have already failed -- aborting

Can someone help me out ?

1 Answer

0 votes
by (38.2k points)

If you use Debian or Ubuntu as a host system, python-lxc package will be available already. The best way to install it is Ansible of course, just before lxc_container tasks:

tasks:

    - name: Install provisioning dependencies

      apt: name=python-lxc

    - name: Create docker1.lxc container

      lxc_container:

        name: docker1

        ...

If you are interested to learn DevOps, I would recommend this Intellipaat’s DevOps Training Course and fast-track your career.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...