diff --git a/orchestrate.py b/orchestrate.py
index 7a75d745b1d1aee7dc1510059af20ec6e9a28d05..08d98204cb47d58fae3c70fe81267c1f429a3005 100755
--- a/orchestrate.py
+++ b/orchestrate.py
@@ -10,6 +10,20 @@ import time
 
 DEFAULT_ACTIONS = ['files', 'ping', 'init', 'wait', 'deployment']
 
+
+def perform_action(action, commands):
+    if component:
+        plugin_commands = component.commands(action)
+        if plugin_commands:
+            commands += plugin_commands
+    for cmd in commands:
+        print('-> %s' % ' '.join(cmd))
+        if not args.dry_run:
+            subprocess.run(cmd)
+    if component:
+        component.action(action)
+
+
 parser = argparse.ArgumentParser(description='terraform cluster orchestrator')
 parser.add_argument('-c', '--config',
                     help='Terraform output for using by orchestrator (default: config.json)',
@@ -139,42 +153,18 @@ if 'init' in args.actions:
     commands += [
         ['ansible', '-i', './inventory', '-m', 'copy', '-a', 'src=hosts dest=/etc/hosts', 'nodes'],
     ]
-    if component:
-        commands += component.commands('init')
-
-    for cmd in commands:
-        print('-> %s' % ' '.join(cmd))
-        if not args.dry_run:
-            subprocess.run(cmd)
-    if component:
-        component.action('init')
+    perform_action('init', commands)
 
 if 'wait' in args.actions:
     print('== wait ==')
-
     commands = [
         ['ansible', '-i', './inventory', '-m', 'command', '-a', 'uname -a', 'all'],
         ['ansible', '-i', './inventory', '-m', 'shell', '-a',
          'while ! test -f /var/lib/cloud/instance/boot-finished; do sleep 2; done', 'all'],
     ]
-
-    for cmd in commands:
-        print('-> %s' % ' '.join(cmd))
-        if not args.dry_run:
-            subprocess.run(cmd)
-    if component:
-        component.action('wait')
+    perform_action('wait', commands)
 
 if 'deployment' in args.actions:
     print('== deployment ==')
-
     commands = []
-    if component:
-        commands += component.commands('deployment')
-
-    for cmd in commands:
-        print('-> %s' % ' '.join(cmd))
-        if not args.dry_run:
-            subprocess.run(cmd)
-    if component:
-        component.action('deployment')
+    perform_action('deployment', commands)