community.general.django_createcachetable module – Wrapper for django-admin createcachetable

Note

This module is part of the community.general collection (version 9.4.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.django_createcachetable.

New in community.general 9.1.0

Synopsis

  • This module is a wrapper for the execution of django-admin createcachetable.

Parameters

Parameter

Comments

database

string

Specify the database to be used.

Default: "default"

pythonpath

path

Adds the given filesystem path to the Python import search path.

The value will be passed as is to the --pythonpath argument in django-admin.

settings

string / required

Specifies the settings module to use.

The value will be passed as is to the --settings argument in django-admin.

skip_checks

boolean

Skips running system checks prior to running the command.

Choices:

  • false

  • true

traceback

boolean

Provides a full stack trace in the output when a CommandError is raised.

Choices:

  • false

  • true

venv

path

Use the the Python interpreter from this virtual environment.

Pass the path to the root of the virtualenv, not the bin/ directory nor the python executable.

verbosity

integer

Specifies the amount of notification and debug information in the output of django-admin.

Choices:

  • 0

  • 1

  • 2

  • 3

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • The django-admin command is always executed using the C locale, and the option --no-color is always passed.

See Also

See also

django-admin and manage.py in official Django documentation

Refer to this documentation for the builtin commands and options of django-admin. Please make sure that you select the right version of Django in the version selector on that page.

Examples

- name: Create cache table in the default database
  community.general.django_createcachetable:
    settings: myproject.settings

- name: Create cache table in the other database
  community.general.django_createcachetable:
    database: myotherdb
    settings: fancysite.settings
    pythonpath: /home/joedoe/project/fancysite
    venv: /home/joedoe/project/fancysite/venv

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

run_info

dictionary

Command-line execution information.

Returned: success and verbosity >= 3

Authors

  • Alexei Znamensky (@russoz)