Add license headers where missing
[fuel.git] / mcp / salt-formulas / maas / machines / mark_broken_fixed.sls
1 ##############################################################################
2 # Copyright (c) 2017 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- from "maas/map.jinja" import region with context %}
9
10 maas_login_admin:
11   cmd.run:
12   - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials"
13
14 # TODO: implement mark_broken_fixed_machine via _modules/maas.py
15 mark_broken_fixed_machine:
16   cmd.run:
17   - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv machine mark-broken {{ pillar['system_id'] }} && sleep 30 && maas opnfv machine mark-fixed {{ pillar['system_id'] }}"
18   - require:
19     - cmd: maas_login_admin