1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- ---
- - name: Create directory
- become: true
- file:
- path: /var/www/myip/
- owner: www-data
- group: www-data
- mode: 0755
- state: directory
- - name: Download source code
- become: true
- get_url:
- url: https://codeberg.org/mark22k/myip.dn42/archive/main.tar.gz
- dest: /var/www/myip/source_code.tar.gz
- mode: 0600
- - name: Unpack source code
- become: true
- unarchive:
- src: /var/www/myip/source_code.tar.gz
- dest: /var/www/myip/
- remote_src: yes
- - name: Replace node id
- become: true
- replace:
- path: /var/www/myip/myip.dn42/public/config.php
- regexp: '\[ASN\]'
- replace: "{{ myip.asn }}"
- - name: Replace node name
- become: true
- replace:
- path: /var/www/myip/myip.dn42/public/config.php
- regexp: '\[NODE\]'
- replace: "{{ myip.node }}"
- - name: Replace location (short)
- become: true
- replace:
- path: /var/www/myip/myip.dn42/public/config.php
- regexp: '\[LOCATION\]'
- replace: "{{ myip.location }}"
- - name: Replace location (long)
- become: true
- replace:
- path: /var/www/myip/myip.dn42/public/config.php
- regexp: '\[LOCATION_FULL\]'
- replace: "{{ myip.location_full }}"
- - name: Set permissions
- become: true
- file:
- path: /var/www/myip/
- owner: www-data
- group: www-data
- state: directory
- recurse: true
|