|-- dev
|-- production
|-- group_vars/
| |-- all.yml
| |-- linux.yml
| |-- windows.yml
This file contains hidden or 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
if ! ansible-playbook -i hosts_azure_rm.yml site.yml --vault-password-file .vault; then | |
echo "Ansible failed!" | |
rm .vault | |
exit 1 | |
else | |
rm .vault | |
fi |
This file contains hidden or 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
$credentials = New-Object Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential -Property @{ StartDate=Get-Date; EndDate=Get-Date -Year 2024; Password='<Password>'}; | |
$spSplat = @{ DisplayName = 'ansible' ; PasswordCredential = $credentials} ; | |
$sp = New-AzAdServicePrincipal @spSplat |
This file contains hidden or 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
TASK [run ping] **************************************************************************** | |
task path: /ansible/ping.yaml:20 | |
<34.202.122.113> ESTABLISH SSH CONNECTION FOR USER: ansible | |
<34.202.122.113> SSH: EXEC sshpass -d9 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="ansible"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/65b11a12a7 34.202.122.113 '/bin/sh -c '"'"'echo ~ansible && sleep 0'"'"'' | |
<34.202.122.113> (3, '', 'sshpass: Failed to run command: No such file or directory\n') | |
<34.202.122.113> Failed to connect to the host via ssh: sshpass: Failed to run command: No such file or directory | |
<34.202.122.113> ESTABLISH SSH CONNECTION FOR USER: ansible | |
<34.202.122.113> SSH: EXEC sshpass -d9 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="ansible"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/65b11a12a7 34.202.122.113 '/bin/sh -c '"'"'echo "`pwd`" && sleep 0'"'"'' | |
<34.202.122.113> (3, '', 'sshpass: |
This file contains hidden or 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
#!/bin/bash | |
sudo apt-get install python -y | |
useradd -m -d /home/ansible -s /bin/bash ansible | |
echo 'ansible:P@ssw0rd'|chpasswd | |
echo 'ansible ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
sudo sed -n 'H;${x;s/\PasswordAuthentication no/PasswordAuthentication yes/;p;}' /etc/ssh/sshd_config > tmp_sshd_config | |
sudo cat tmp_sshd_config > /etc/ssh/sshd_config | |
rm -f tmp_sshd_config | |
sudo service sshd restart |
This file contains hidden or 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
code --install-extension 'wilfriedwoivre.arm-params-generator'; | |
code --install-extension 'bencoleman.armview'; | |
code --install-extension 'msazurermtools.azurerm-vscode-tools'; | |
code --install-extension 'samcogan.arm-snippets'; | |
code --install-extension 'ms-vscode.azure-account'; | |
code --install-extension 'ms-azuretools.vscode-azurefunctions'; | |
code --install-extension 'docsmsft.docs-markdown'; | |
code --install-extension 'docsmsft.docs-authoring-pack'; | |
code --install-extension 'ms-azure-devops.azure-pipelines'; |
This file contains hidden or 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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: mysql-config | |
labels: | |
app: mysql | |
data: | |
mysql_binlog_format.cnf: | | |
[mysqld] | |
binlog-format=mixed |
- Deploy v1 of the app
kubectl apply -f archetype-deployment-and-service-recreate.yaml
- Change the .spec.template.spec.containers.image to v2
kubectl set image deployment archetype-deployment archetype=duffney/archetype:v2
- Check pods & replicaset
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: archetype-deployment | |
labels: | |
app: archetype | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: |
- Edit ReplicationController or ReplicaSet.
kubectl edit replicaset archetype
- Update Pod template to use a newer image.
#within the config modify the template image #confirm settings with kubectl get replicaset archetype -o yaml