我如何避免在我的Ansible角色中自动创建.travis.yml文件?

发布于 2025-02-04 03:25:56 字数 830 浏览 5 评论 0原文

我已经使用Ansible-galaxy Init my_role创建了多个角色,过了一会儿,我意识到.travis.yml文件是自动为基本语法测试而自动创建的。我不打算使用Travis CI,因此此.travis.yml文件是没有用的。

我相信这是有充分的理由,因此,如果您也可以解释一下,我会很感激。

这是文件:

---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
  apt:
    packages:
    - python-pip

install:
  # Install ansible
  - pip install ansible

  # Check ansible version
  - ansible --version

  # Create ansible.cfg with correct roles_path
  - printf '[defaults]\nroles_path=../' >ansible.cfg

script:
  # Basic role syntax check
  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

I have created several roles with ansible-galaxy init my_role and after a while I realized a .travis.yml file was created automatically for a basic syntax testing. I am not planning to use Travis CI, so this .travis.yml file is useless.

I am sure there is a good reason why this occurred, so if you may also explain it I would be thankful.

This is the file:

---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
  apt:
    packages:
    - python-pip

install:
  # Install ansible
  - pip install ansible

  # Check ansible version
  - ansible --version

  # Create ansible.cfg with correct roles_path
  - printf '[defaults]\nroles_path=../' >ansible.cfg

script:
  # Basic role syntax check
  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听你说爱我 2025-02-11 03:25:56

它是默认角色骨架的一部分。如果要使用其他骨架,请使用使用- code> - cole> - copor-skeleton flag:

ansible-galaxy init --role-skeleton ~/ansible-skeletons/role roles/foo

It's part of the default role skeleton. If you want to use a different skeleton, pass it to ansible-galaxy using the --role-skeleton flag:

ansible-galaxy init --role-skeleton ~/ansible-skeletons/role roles/foo
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文