|
|
@ -17,6 +17,8 @@
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from novaclient.v1_1 import client as nova_client
|
|
|
|
from novaclient.v1_1 import client as nova_client
|
|
|
|
from novaclient import exceptions
|
|
|
|
from novaclient import exceptions
|
|
|
@ -224,13 +226,8 @@ def _get_server_state(module, nova):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec = openstack_argument_spec()
|
|
|
|
argument_spec = dict(
|
|
|
|
argument_spec.update(dict(
|
|
|
|
login_username = dict(default='admin'),
|
|
|
|
|
|
|
|
login_password = dict(required=True),
|
|
|
|
|
|
|
|
login_tenant_name = dict(required='True'),
|
|
|
|
|
|
|
|
auth_url = dict(default='http://127.0.0.1:35357/v2.0/'),
|
|
|
|
|
|
|
|
region_name = dict(default=None),
|
|
|
|
|
|
|
|
name = dict(required=True),
|
|
|
|
name = dict(required=True),
|
|
|
|
image_id = dict(default=None),
|
|
|
|
image_id = dict(default=None),
|
|
|
|
flavor_id = dict(default=1),
|
|
|
|
flavor_id = dict(default=1),
|
|
|
@ -241,9 +238,9 @@ def main():
|
|
|
|
wait = dict(default='yes', choices=['yes', 'no']),
|
|
|
|
wait = dict(default='yes', choices=['yes', 'no']),
|
|
|
|
wait_for = dict(default=180),
|
|
|
|
wait_for = dict(default=180),
|
|
|
|
state = dict(default='present', choices=['absent', 'present']),
|
|
|
|
state = dict(default='present', choices=['absent', 'present']),
|
|
|
|
user_data = dict(default=None)
|
|
|
|
user_data = dict(default=None),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
)
|
|
|
|
module = AnsibleModule(argument_spec=argument_spec)
|
|
|
|
|
|
|
|
|
|
|
|
nova = nova_client.Client(module.params['login_username'],
|
|
|
|
nova = nova_client.Client(module.params['login_username'],
|
|
|
|
module.params['login_password'],
|
|
|
|
module.params['login_password'],
|
|
|
@ -270,5 +267,6 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# this is magic, see lib/ansible/module.params['common.py
|
|
|
|
# this is magic, see lib/ansible/module.params['common.py
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
from ansible.module_utils.openstack import *
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|
|
|
|
|
|
|
|
|