Skip to content

Commit

Permalink
feat: add 'meza enforce-meza-version' command
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontalvo3 committed Oct 3, 2023
1 parent 07e4bb1 commit a67b969
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/playbooks/enforce-meza-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- hosts: localhost
become: yes
roles:
- set-vars
- enforce-meza-version
14 changes: 14 additions & 0 deletions src/scripts/meza.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,20 @@ def meza_command_push_backup (argv):
meza_shell_exec_exit(rc)


def meza_command_enforce_meza_version (argv):

env = argv[0]

rc = check_environment(env)
if rc != 0:
meza_shell_exec_exit(rc)

shell_cmd = playbook_cmd( 'enforce-meza-version', env ) + argv[1:]
rc = meza_shell_exec( shell_cmd )

meza_shell_exec_exit(rc)


def playbook_cmd ( playbook, env=False, more_extra_vars=False ):
command = ['sudo', '-u', 'meza-ansible', 'ansible-playbook',
'{}/meza/src/playbooks/{}.yml'.format(install_dir, playbook)]
Expand Down

0 comments on commit a67b969

Please sign in to comment.