-
-
Save marcoceppi/6779616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import amulet | |
d = amulet.Deployment() | |
d.add('mysql') | |
d.add('wordpress', units=3) | |
d.relate('mysql:db', 'wordpress:db') | |
d.configure('wordpress', tuning='bare') | |
# Runs deployer | |
d.setup(timeout=900) | |
d.sentry.wait() # Setup only goes so far as to stringing things together and making sure it says 'started', this makes sure there are no more hooks running. AKA: Actually ready. | |
relation_data = d.sentry.unit['mysql/0'].relation('db', 'wordpress:db') # This will be an object of the keys and values sent over the relation | |
d.sentry.unit['wordpress/0'].file_exists('/var/www/wp-config.php') | |
contents = d.sentry.unit['wordpress/0'].file_contents('/var/www/wp-config.php') | |
plugins = d.sentry.unit['wordpress/0'].directory_contents('/var/www/wp-content/plugins') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment