如何在 juju 中创建 ansible charm

如何在 juju 中创建 ansible charm

我正在尝试使用 ansible 创建自己的 charm。当我使用“charm create”执行此操作时,出现以下错误:

root@charms:~/charms/precise# charm create -t ansible ansi

INFO: Generating charm for ansi in ./ansi
INFO: No ansi in apt cache; creating an empty charm instead.
INFO:root:Loading charm helper config from charm-helpers.yaml.
INFO:root:Checking out lp:charm-helpers to /tmp/tmpJbpY6C/charm-helpers.
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 790 revisions.
WARNING:root:Could not sync: core. Neither a pyfile or directory, does it even exist?
WARNING:root:Could not sync: fetch. Neither a pyfile or directory, does it even exist?
WARNING:root:Could not sync: contrib.ansible. Neither a pyfile or directory, does it even exist?
WARNING:root:Could not sync: contrib.templating.contexts. Neither a pyfile or directory, does it even exist?
root@charms:~/charms/precise# 

我正在使用 2.3.4 版本的 juju,并安装了最新版本的 python 和 ansible。

root@charms:~# juju --version
2.3.4-xenial-amd64
root@charms:~#

我还安装了 charm-tools 包。

root@charms:~# dpkg -l | grep charm

ii  charm                                      2.2.0-0ubuntu1~ubuntu16.04.1~ppa2            amd64        Tool for publishing and maintaining Juju charms
ii  charm-tools                                2.2.0-0ubuntu1~ubuntu16.04.1~ppa2            all          Tools for maintaining Juju charms
ii  gucharmap                                  1:3.18.2-1ubuntu1                            amd64        Unicode character picker and font browser
ii  libgucharmap-2-90-7:amd64                  1:3.18.2-1ubuntu1                            amd64        Unicode browser widget library (shared library)
ii  python-libcharmstore                       0.0.3-0ubuntu1                               all          Python library to access Juju charmstore data
ii  python-theblues                            0.3.7-0ubuntu1~ubuntu16.04.1~ppa2            all          Python library for using the Juju charm store API
root@charms:~#

如何获取 core、fetch、contrib.ansible、contrib.templating.contexts 丢失的 pyfile?

请帮忙。

答案1

要制作使用 ansible 的 charm,您不需要使用 ansible 模板。您只需使用默认模板创建一个 charm 并添加 ansible 层即可。如何做到这一点可以在这里找到邮政。确保您正在使用 charm 的 snap 包并删除 apt-package。

sudo apt-get purge charm
sudo snap install charm
charm create ansi

现在您的饰品已经创建完毕,您可以开始为饰品编写代码。

相关内容