Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename playbook.yml to converge.yml #2533

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/ci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ The following `Jenkinsfile` uses the official 'quay.io/ansible/molecule' image.

.. note::

For Jenkins to work properly using a `Multibranch Pipeline` or a `GitHub Organisation` - as used by Blue Ocean, the role name in the scenario/playbook.yml should be changed to perform a lookup of the role root directory. For example :
For Jenkins to work properly using a `Multibranch Pipeline` or a `GitHub Organisation` - as used by Blue Ocean, the
role name in the scenario converge.yml should be changed to perform a lookup of the role root directory. For example :

.. code-block:: yaml

Expand Down
4 changes: 2 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ test roles from a monolith repo.
└── README.md

The role initialized with Molecule (baz in this case) would simply reference
the dependant roles via it's ``playbook.yml`` or meta dependencies.
the dependant roles via it's ``converge.yml`` or meta dependencies.

Molecule can test complex scenarios leveraging this technique.

Expand Down Expand Up @@ -264,7 +264,7 @@ Playbooks and tests can be shared across scenarios.
│   │   │   ├── Dockerfile.j2 (optional)
│   │   │   ├── create.yml
│   │   │   ├── destroy.yml
│   │   │   ├── playbook.yml
│   │   │   ├── converge.yml # <-- previously called playbook.yml
│   │   │   └── prepare.yml
│   │   └── tests
│   │   └── test_default.py
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ directories:
.. code-block:: bash

$ ls
Dockerfile.j2 INSTALL.rst molecule.yml playbook.yml tests
Dockerfile.j2 INSTALL.rst molecule.yml converge.yml tests

* Since `Docker`_ is the default :ref:`driver`, we find a ``Dockerfile.j2``
`Jinja2`_ template file in place. Molecule will use this file to build a
Expand All @@ -79,7 +79,7 @@ directories:
this file, you can configure each tool that Molecule will employ when testing
your role.

* ``playbook.yml`` is the playbook file that contains the call site for your
* ``converge.yml`` is the playbook file that contains the call for your
role. Molecule will invoke this playbook with ``ansible-playbook`` and run it
against an instance created by the driver.

Expand Down
2 changes: 1 addition & 1 deletion molecule/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _get_defaults(self):
'playbooks': {
'cleanup': 'cleanup.yml',
'create': 'create.yml',
'converge': 'playbook.yml',
'converge': 'converge.yml',
'destroy': 'destroy.yml',
'prepare': 'prepare.yml',
'side_effect': 'side_effect.yml',
Expand Down
17 changes: 13 additions & 4 deletions molecule/provisioner/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Ansible(base.Base):
vvv: True
playbooks:
create: create.yml
converge: playbook.yml
converge: converge.yml
destroy: destroy.yml

Share playbooks between roles.
Expand All @@ -111,7 +111,7 @@ class Ansible(base.Base):
playbooks:
create: ../default/create.yml
destroy: ../default/destroy.yml
converge: playbook.yml
converge: converge.yml

Multiple driver playbooks. In some situations a developer may choose to
test the same role against different backends. Molecule will choose driver
Expand All @@ -133,7 +133,7 @@ class Ansible(base.Base):
destroy: destroy.yml
create: create.yml
destroy: destroy.yml
converge: playbook.yml
converge: converge.yml

.. important::

Expand Down Expand Up @@ -687,7 +687,16 @@ def converge(self, playbook=None, **kwargs):
:return: str
"""
if playbook is None:
pb = self._get_ansible_playbook(self.playbooks.converge, **kwargs)
p = self.playbooks.converge
# TODO(ssbarnea): Remove that deprecation fallback in 3.1+
if os.path.basename(p) == "converge.yml" and not os.path.isfile(p):
old_name = os.path.join(os.path.dirname(p), "playbook.yml")
if os.path.isfile(old_name):
LOG.warning(
"playbook.yml was deprecated, rename it to converge.yml"
)
p = old_name
pb = self._get_ansible_playbook(p, **kwargs)
else:
pb = self._get_ansible_playbook(playbook, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion molecule/test/unit/provisioner/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def test_playbooks_create_property(_instance):


def test_playbooks_converge_property(_instance):
x = os.path.join(_instance._config.scenario.directory, 'playbook.yml')
x = os.path.join(_instance._config.scenario.directory, 'converge.yml')

assert x == _instance.playbooks.converge

Expand Down
2 changes: 1 addition & 1 deletion molecule/test/unit/provisioner/test_ansible_playbooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_create_property(_instance):


def test_converge_property(_instance):
x = os.path.join(_instance._config.scenario.directory, 'playbook.yml')
x = os.path.join(_instance._config.scenario.directory, 'converge.yml')

assert x == _instance._config.provisioner.playbooks.converge

Expand Down