我有很多想要通过 测试的角色molecule
,而且我是molecule
初学者。
如果我在每个角色中创建一个分子场景,就会有大量的重复代码。
是否存在人们用来避免具有相同 , 等的许多角色的Dockerfile.j2
模式molecule.yml
?
也许某种组合(通过依赖注入)或者如果这不可行某种继承?
$ molecule init role -r stackoverflow
--> Initializing new role stackoverflow...
Initialized role in /private/tmp/stackoverflow successfully.
$ tree stackoverflow
stackoverflow
├── README.md
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── molecule
│ └── default
│ ├── Dockerfile.j2
│ ├── INSTALL.rst
│ ├── molecule.yml
│ ├── playbook.yml
│ └── tests
│ ├── test_default.py
│ └── test_default.pyc
├── tasks
│ └── main.yml
└── vars
└── main.yml
8 directories, 12 files