Last active
January 4, 2016 20:49
-
-
Save starenka/8676644 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
#tady je priklad jednoho projektu: | |
# [-]luft_vagrant | |
# [+].hg | |
# .hgignore | |
# [+].vagrant | |
# README.md | |
# Vagrantfile | |
# [-]provisioning | |
# ansible_hosts | |
# playbook.yml | |
# [-]roles | |
# [+]base | |
# [+]common | |
# [-]luft_dev | |
# [-]files | |
# luft.sql | |
# luft_authorized.keys | |
# luft_celery_supervisor.conf | |
# luft_id_rsa | |
# luft_id_rsa.pub | |
# luft_known_hosts | |
# luft_nginx.conf | |
# luft_supervisor.conf | |
# pushup_nginx.conf | |
# pushup_supervisor.conf | |
# sudoers | |
# supervisor.conf | |
# vagrant_pub.key | |
# [+]handlers | |
# [-]tasks | |
# luftapp.yml | |
# main.yml | |
# nginx.yml | |
# pushup.yml | |
# repos.yml | |
# supervisor.yml | |
# users.yml | |
# [+]templates | |
# [+]pythons | |
# [+]webstack | |
# vagrant_ansible_inventory_default | |
#rekneme, ze jedna role bude tvoje aplikace (tady viz luft_dev treba). napises tedy do ni do adresare tasks nejakej yml file, kde bude neco jako: (je lepsi to drobit a pak ty soubory nainkludovat do main.yml) | |
- name: checkout project | |
shell: hg clone ssh://meh@repo.eh.cz://home/meh/repos/project /var/www/project creates=/var/www/project | |
sudo: no | |
remote_user: project_user | |
#za predpokladu, ze mas poreseny klice. zalezi jakej je tvuj pripad, ale rekneme, | |
#ze mas private & public par k dispozici, kterej server, kde mas git repo bere, | |
#tak pak ho staci nahrat tomu userovi, pod kterym predchozi prikaz poustis | |
#(ty tri pouzity soubory niz se berou z adresare files pro danou roli). | |
- name: cp repo user ssh private key | |
copy: src=project_user_id_rsa dest=/home/project_user/.ssh/id_rsa mode=0600 group=project_user owner=project_user | |
- name: cp repo user ssh pub key | |
copy: src=project_user_id_rsa.pub dest=/home/project_user/.ssh/id_rsa.pub mode=0655 group=project_user owner=project_user | |
- name: add git server to known hosts | |
copy: src=reposerver_known_hosts dest=/home/project_user/.ssh/known_hosts group=project_user owner=project_user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment